diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2014-08-25 14:00:35 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2014-08-25 14:00:35 +0000 |
commit | 970b26ec4389cce4f07f4d0afcdfda199a9118be (patch) | |
tree | 957d4a6f7d0b5d0af482bcf1a4687ab0af5f785b /sys/net/if.c | |
parent | 1910644611fb8118754549f7bd25101f9d025b6c (diff) |
Move sending of router solicitations to the kernel; receiving and
processing of router advertisements was already in the kernel.
With this rtsol{,d}(8) is no longer necessary.
The kernel starts sending solicitations with
# ifconfig $IF inet6 autoconf
or
inet6 autoconf
in /etc/hostname.$IF.
input stsp@
much help & OK mpi@
tweaks & OK bluhm@
Diffstat (limited to 'sys/net/if.c')
-rw-r--r-- | sys/net/if.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 92c2d167c65..3b54d7abaee 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.299 2014/08/14 11:38:14 mikeb Exp $ */ +/* $OpenBSD: if.c,v 1.300 2014/08/25 14:00:34 florian Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -1339,6 +1339,26 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p) splx(s); } } + + if (ifr->ifr_flags & IFXF_AUTOCONF6) + nd6_rs_output_set_timo(ND6_RS_OUTPUT_QUICK_INTERVAL); + + if ((ifr->ifr_flags & IFXF_AUTOCONF6) && + !(ifp->if_xflags & IFXF_AUTOCONF6)) { + nd6_rs_timeout_count++; + RS_LHCOOKIE(ifp) = hook_establish( + ifp->if_linkstatehooks, 1, nd6_rs_dev_state, ifp); + if (!timeout_pending(&nd6_rs_output_timer)) + nd6_rs_output_set_timo(nd6_rs_output_timeout); + } + if ((ifp->if_xflags & IFXF_AUTOCONF6) && + !(ifr->ifr_flags & IFXF_AUTOCONF6)) { + hook_disestablish(ifp->if_linkstatehooks, + RS_LHCOOKIE(ifp)); + nd6_rs_timeout_count--; + if (nd6_rs_timeout_count == 0) + timeout_del(&nd6_rs_output_timer); + } #endif #ifdef MPLS |