summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2015-02-05 10:30:25 +0000
committerhenning <henning@openbsd.org>2015-02-05 10:30:25 +0000
commit0229d4e300f824dfcf4ee6e6e2df91060521fffd (patch)
treeedb7f45f030c057ba76336afe08479d108cd1189
parentWrap all the individual format_* calls in a single format_defaults (diff)
downloadwireguard-openbsd-0229d4e300f824dfcf4ee6e6e2df91060521fffd.tar.xz
wireguard-openbsd-0229d4e300f824dfcf4ee6e6e2df91060521fffd.zip
implement "ifconfig <if> -inet", removing all inet addresses
for symmetry with -inet6 mostly. ok phessler theo
-rw-r--r--sbin/ifconfig/ifconfig.88
-rw-r--r--sbin/ifconfig/ifconfig.c4
2 files changed, 9 insertions, 3 deletions
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8
index 3b312ddf53a..c54b893a8c4 100644
--- a/sbin/ifconfig/ifconfig.8
+++ b/sbin/ifconfig/ifconfig.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ifconfig.8,v 1.250 2015/02/02 08:25:05 jmc Exp $
+.\" $OpenBSD: ifconfig.8,v 1.251 2015/02/05 10:30:25 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 $
.\"
@@ -31,7 +31,7 @@
.\"
.\" @(#)ifconfig.8 8.4 (Berkeley) 6/1/94
.\"
-.Dd $Mdocdate: February 2 2015 $
+.Dd $Mdocdate: February 5 2015 $
.Dt IFCONFIG 8
.Os
.Sh NAME
@@ -288,6 +288,10 @@ The device supports Wake on LAN (WoL).
.It Sy hardmtu
The maximum MTU supported.
.El
+.It Fl inet
+Remove all configured
+.Xr inet 4
+addresses on the given interface.
.It Fl inet6
Disable
.Xr inet6 4
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 4df0bf33634..038766db991 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifconfig.c,v 1.295 2015/01/16 06:39:58 deraadt Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.296 2015/02/05 10:30:25 henning Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
@@ -420,6 +420,7 @@ const struct cmd {
{ "flowdst", NEXTARG, 0, setpflow_receiver },
{ "-flowdst", 1, 0, unsetpflow_receiver },
{ "pflowproto", NEXTARG, 0, setpflowproto },
+ { "-inet", AF_INET, 0, removeaf },
{ "-inet6", AF_INET6, 0, removeaf },
{ "keepalive", NEXTARG2, 0, NULL, setkeepalive },
{ "-keepalive", 1, 0, unsetkeepalive },
@@ -481,6 +482,7 @@ const struct cmd {
{ "txpower", NEXTARG, 0, setignore },
{ "nwflag", NEXTARG, 0, setignore },
{ "rdomain", NEXTARG, 0, setignore },
+ { "-inet", AF_INET, 0, removeaf },
{ "-inet6", AF_INET6, 0, removeaf },
{ "description", NEXTARG, 0, setignore },
{ "descr", NEXTARG, 0, setignore },