summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2009-11-12 19:02:10 +0000
committerdelphij <delphij@FreeBSD.org>2009-11-12 19:02:10 +0000
commit8fed657163fb373990aaa15c79b58a7c963373b2 (patch)
tree16ac7b8e4875faf8659392bffa9753b287fa7398 /sbin
parent2f448a4a2a88e26012aba2a9ddf375e1a9f2eed1 (diff)
downloadFreeBSD-src-8fed657163fb373990aaa15c79b58a7c963373b2.zip
FreeBSD-src-8fed657163fb373990aaa15c79b58a7c963373b2.tar.gz
Revert revision 199201 for now as it has introduced a kernel vulnerability
and requires more polishing.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ifconfig/ifconfig.812
-rw-r--r--sbin/ifconfig/ifconfig.c53
2 files changed, 1 insertions, 64 deletions
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8
index 211b1ef..220bd9f 100644
--- a/sbin/ifconfig/ifconfig.8
+++ b/sbin/ifconfig/ifconfig.8
@@ -28,7 +28,7 @@
.\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94
.\" $FreeBSD$
.\"
-.Dd November 11, 2009
+.Dd September 23, 2009
.Dt IFCONFIG 8
.Os
.Sh NAME
@@ -258,12 +258,6 @@ Disable permanently promiscuous mode.
Another name for the
.Fl alias
parameter.
-.It Cm description Ar value
-Specify a description of the interface.
-This can be used to label interfaces in situations where they may
-otherwise be difficult to distinguish.
-.It Cm -description
-Clear the interface description.
.It Cm down
Mark an interface
.Dq down .
@@ -2518,10 +2512,6 @@ Configure the interface
to use 100baseTX, full duplex Ethernet media options:
.Dl # ifconfig xl0 media 100baseTX mediaopt full-duplex
.Pp
-Label the em0 interface as an uplink:
-.Pp
-.Dl # ifconfig em0 description \&"Uplink to Gigabit Switch 2\&"
-.Pp
Create the software network interface
.Li gif1 :
.Dl # ifconfig gif1 create
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index e08bb4f..f05374c 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -83,8 +83,6 @@ static const char rcsid[] =
struct ifreq ifr;
char name[IFNAMSIZ];
-char *descr = NULL;
-size_t descrlen = 64;
int setaddr;
int setmask;
int doalias;
@@ -824,36 +822,6 @@ setifname(const char *val, int dummy __unused, int s,
free(newname);
}
-/* ARGSUSED */
-static void
-setifdescr(const char *val, int dummy __unused, int s,
- const struct afswtch *afp)
-{
- char *newdescr;
-
- newdescr = strdup(val);
- if (newdescr == NULL) {
- warn("no memory to set ifdescr");
- return;
- }
- ifr.ifr_buffer.buffer = newdescr;
- ifr.ifr_buffer.length = strlen(newdescr);
- if (ioctl(s, SIOCSIFDESCR, (caddr_t)&ifr) < 0) {
- warn("ioctl (set descr)");
- free(newdescr);
- return;
- }
- free(newdescr);
-}
-
-/* ARGSUSED */
-static void
-unsetifdescr(const char *val, int value, int s, const struct afswtch *afp)
-{
-
- setifdescr("", 0, s, 0);
-}
-
#define IFFBITS \
"\020\1UP\2BROADCAST\3DEBUG\4LOOPBACK\5POINTOPOINT\6SMART\7RUNNING" \
"\10NOARP\11PROMISC\12ALLMULTI\13OACTIVE\14SIMPLEX\15LINK0\16LINK1\17LINK2" \
@@ -898,23 +866,6 @@ status(const struct afswtch *afp, const struct sockaddr_dl *sdl,
printf(" mtu %d", ifr.ifr_mtu);
putchar('\n');
- descr = reallocf(descr, descrlen);
- if (descr != NULL) {
- do {
- ifr.ifr_buffer.buffer = descr;
- ifr.ifr_buffer.length = descrlen;
- if (ioctl(s, SIOCGIFDESCR, &ifr) == 0) {
- if (strlen(descr) > 0)
- printf("\tdescription: %s\n", descr);
- break;
- }
- if (errno == ENAMETOOLONG) {
- descrlen *= 2;
- descr = reallocf(descr, descrlen);
- }
- } while (errno == ENAMETOOLONG);
- }
-
if (ioctl(s, SIOCGIFCAP, (caddr_t)&ifr) == 0) {
if (ifr.ifr_curcap != 0) {
printb("\toptions", ifr.ifr_curcap, IFCAPBITS);
@@ -1084,10 +1035,6 @@ static struct cmd basic_cmds[] = {
DEF_CMD("-arp", IFF_NOARP, setifflags),
DEF_CMD("debug", IFF_DEBUG, setifflags),
DEF_CMD("-debug", -IFF_DEBUG, setifflags),
- DEF_CMD_ARG("description", setifdescr),
- DEF_CMD_ARG("descr", setifdescr),
- DEF_CMD("-description", 0, unsetifdescr),
- DEF_CMD("-descr", 0, unsetifdescr),
DEF_CMD("promisc", IFF_PPROMISC, setifflags),
DEF_CMD("-promisc", -IFF_PPROMISC, setifflags),
DEF_CMD("add", IFF_UP, notealias),
OpenPOWER on IntegriCloud