summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sbin/ifconfig/ifconfig.84
-rw-r--r--sbin/ifconfig/ifconfig.c14
2 files changed, 16 insertions, 2 deletions
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8
index b766606a5f8..d1ad210720e 100644
--- a/sbin/ifconfig/ifconfig.8
+++ b/sbin/ifconfig/ifconfig.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ifconfig.8,v 1.111 2005/09/21 21:35:17 jmc Exp $
+.\" $OpenBSD: ifconfig.8,v 1.112 2005/11/14 15:06:09 henning Exp $
.\" $NetBSD: ifconfig.8,v 1.11 1996/01/04 21:27:29 pk Exp $
.\" $FreeBSD: ifconfig.8,v 1.16 1998/02/01 07:03:29 steve Exp $
.\"
@@ -370,6 +370,8 @@ configured onto a tunnel interface.
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 destroy
Destroy the specified network pseudo-device.
.It Cm down
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index a7d7228fa8c..618f054901d 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifconfig.c,v 1.152 2005/11/01 07:54:26 deraadt Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.153 2005/11/14 15:06:09 henning Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
@@ -148,6 +148,7 @@ void setifdstaddr(const char *, int);
void setifflags(const char *, int);
void setifbroadaddr(const char *, int);
void setifdesc(const char *, int);
+void unsetifdesc(const char *, int);
void setifipdst(const char *, int);
void setifmetric(const char *, int);
void setifmtu(const char *, int);
@@ -346,6 +347,8 @@ const struct cmd {
{ "lladdr", NEXTARG, 0, setiflladdr },
{ "description", NEXTARG, 0, setifdesc },
{ "descr", NEXTARG, 0, setifdesc },
+ { "-description", 1, 0, unsetifdesc },
+ { "-descr", 1, 0, unsetifdesc },
{ NULL, /*src*/ 0, 0, setifaddr },
{ NULL, /*dst*/ 0, 0, setifdstaddr },
{ NULL, /*illegal*/0, 0, NULL },
@@ -904,6 +907,15 @@ setifdesc(const char *val, int ignored)
/* ARGSUSED */
void
+unsetifdesc(const char *noval, int ignored)
+{
+ ifr.ifr_data = (caddr_t)(const char *)"";
+ if (ioctl(s, SIOCSIFDESCR, &ifr) < 0)
+ warn("SIOCSIFDESCR");
+}
+
+/* ARGSUSED */
+void
setifipdst(const char *addr, int ignored)
{
in_getaddr(addr, DSTADDR);