summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2015-02-05 10:28:51 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2015-02-05 10:28:51 +0000
commita260dfa82e0bf8576b9a0c10e17ea4eb5a87b620 (patch)
tree593469807fac0389ebf7b7c0a52279c73f989d27
parent3b1b3a22d1e8c270c4c59c41942c857763b814ab (diff)
implement SIOCIFAFATTACH and SIOCIFAFDETACH for AF_INET
SIOCIFAFATTACH is a noop SIOCIFAFDETACH calls in_ifdetach(), thus removing all AF_INET addresses ok phessler theo
-rw-r--r--sys/net/if.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index a4dc97f0139..6b83e3dbdf9 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.315 2015/01/27 10:31:19 mpi Exp $ */
+/* $OpenBSD: if.c,v 1.316 2015/02/05 10:28:50 henning Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -1235,6 +1235,14 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
if ((ifp = ifunit(ifar->ifar_name)) == NULL)
return (ENXIO);
switch (ifar->ifar_af) {
+ case AF_INET:
+ /* attach is a noop for AF_INET */
+ if (cmd == SIOCIFAFDETACH) {
+ s = splsoftnet();
+ in_ifdetach(ifp);
+ splx(s);
+ }
+ return (0);
#ifdef INET6
case AF_INET6:
s = splsoftnet();