From 970b26ec4389cce4f07f4d0afcdfda199a9118be Mon Sep 17 00:00:00 2001 From: Florian Obser Date: Mon, 25 Aug 2014 14:00:35 +0000 Subject: 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@ --- sys/net/if.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'sys/net/if.c') 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 -- cgit v1.2.3