diff options
author | 2015-02-05 10:28:50 +0000 | |
---|---|---|
committer | 2015-02-05 10:28:50 +0000 | |
commit | 5d41b523247ceffcb814fde9e094655369eab84b (patch) | |
tree | 5c719d6e73e430e3404ea09cb8030ba0ad98c510 | |
parent | There is no need to save the guard state because the function checks it (diff) | |
download | wireguard-openbsd-5d41b523247ceffcb814fde9e094655369eab84b.tar.xz wireguard-openbsd-5d41b523247ceffcb814fde9e094655369eab84b.zip |
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.c | 10 |
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(); |