On 26/12/16(Mon) 12:15, Sebastien Marie wrote:
> Hi,
> 
> As the number of splassert reports was lower, I tried to update my
> gateway in order to contribute a bit :)
> 
> The kernel is -current (rebuild locally), and the rest is latest snapshot 
> from:
> 
> OpenBSD 6.0-current (GENERIC.MP) #71: Fri Dec 23 12:08:23 MST 2016
> 
> Below is full dmesg, with several splassert and stacktrace (I am running
> with kern.splassert=2).
> 
> Some context, my gateway has:
>   - vlans
>   - pppoe with inet and inet6
>   - dhcpcd with prefix-delegation
>   - rtadvd
> 
> From dmesg, I found 2 kinds of splassert (for what I saw):
> 
>   - one related to pppoe
>       if_linkstate() at if_linkstate+0x3c
>       sppp_lcp_down() at sppp_lcp_down+0x42
>       pppoe_timeout() at pppoe_timeout+0x355
>       timeout_run() at timeout_run+0x48
>       softclock() at softclock+0x147
>       softintr_dispatch() at softintr_dispatch+0x8b
>       Xsoftclock() at Xsoftclock+0x1f
> 
>   - one related to pppoe+ipv6
>       sorwakeup() at sorwakeup+0x3c
>       route_input() at route_input+0x349
>       if_linkstate() at if_linkstate+0x5f
>       sppp_ioctl() at sppp_ioctl+0xae
>       pppoe_ioctl() at pppoe_ioctl+0x70
>       in6_ifinit() at in6_ifinit+0xc5
>       in6_update_ifa() at in6_update_ifa+0x1f5
>       sppp_update_ip6_addr() at sppp_update_ip6_addr+0xcc
>       taskq_thread() at taskq_thread+0x6c

Thanks for the report, diff below should fix these.

Index: net/if_pppoe.c
===================================================================
RCS file: /cvs/src/sys/net/if_pppoe.c,v
retrieving revision 1.57
diff -u -p -r1.57 if_pppoe.c
--- net/if_pppoe.c      14 Jun 2016 20:44:43 -0000      1.57
+++ net/if_pppoe.c      29 Dec 2016 07:43:07 -0000
@@ -223,7 +223,7 @@ pppoe_clone_create(struct if_clone *ifc,
        memcpy(&sc->sc_dest, etherbroadcastaddr, sizeof(sc->sc_dest));
        
        /* init timer for interface watchdog */
-       timeout_set(&sc->sc_timeout, pppoe_timeout, sc);
+       timeout_set_proc(&sc->sc_timeout, pppoe_timeout, sc);
        
        if_attach(&sc->sc_sppp.pp_if);
        if_alloc_sadl(&sc->sc_sppp.pp_if);
@@ -1056,10 +1056,12 @@ static void
 pppoe_timeout(void *arg)
 {
        struct pppoe_softc *sc = (struct pppoe_softc *)arg;
-       int x, retry_wait, err;
+       int s, x, retry_wait, err;
 
        PPPOEDEBUG(("%s: timeout\n", sc->sc_sppp.pp_if.if_xname));
 
+       NET_LOCK(s);
+
        switch (sc->sc_state) {
        case PPPOE_STATE_PADI_SENT:
                /*
@@ -1084,7 +1086,7 @@ pppoe_timeout(void *arg)
                        } else {
                                pppoe_abort_connect(sc);
                                splx(x);
-                               return;
+                               break;
                        }
                }
                if ((err = pppoe_send_padi(sc)) != 0) {
@@ -1111,7 +1113,7 @@ pppoe_timeout(void *arg)
                        timeout_add(&sc->sc_timeout,
                            PPPOE_DISC_TIMEOUT * (1 + sc->sc_padi_retried));
                        splx(x);
-                       return;
+                       break;
                }
                if ((err = pppoe_send_padr(sc)) != 0) {
                        sc->sc_padr_retried--;
@@ -1127,8 +1129,10 @@ pppoe_timeout(void *arg)
                pppoe_disconnect(sc);
                break;
        default:
-               return; /* all done, work in peace */
+               break;  /* all done, work in peace */
        }
+
+       NET_UNLOCK(s);
 }
 
 /* Start a connection (i.e. initiate discovery phase). */
Index: net/if_spppsubr.c
===================================================================
RCS file: /cvs/src/sys/net/if_spppsubr.c,v
retrieving revision 1.157
diff -u -p -r1.157 if_spppsubr.c
--- net/if_spppsubr.c   19 Dec 2016 08:36:49 -0000      1.157
+++ net/if_spppsubr.c   29 Dec 2016 07:40:31 -0000
@@ -4242,11 +4242,11 @@ sppp_set_ip_addrs(void *arg1)
                if (debug && error) {
                        log(LOG_DEBUG, SPP_FMT "sppp_set_ip_addrs: in_ifinit "
                        " failed, error=%d\n", SPP_ARGS(ifp), error);
-                       NET_UNLOCK(s);
-                       return;
+                       goto out;
                }
                sppp_update_gw(ifp);
        }
+out:
        NET_UNLOCK(s);
 }
 
@@ -4303,11 +4303,11 @@ sppp_clear_ip_addrs(void *arg1)
                if (debug && error) {
                        log(LOG_DEBUG, SPP_FMT "sppp_clear_ip_addrs: in_ifinit "
                        " failed, error=%d\n", SPP_ARGS(ifp), error);
-                       NET_UNLOCK(s);
-                       return;
+                       goto out;
                }
                sppp_update_gw(ifp);
        }
+out:
        NET_UNLOCK(s);
 }
 
@@ -4361,13 +4361,12 @@ sppp_update_ip6_addr(void *arg)
        struct in6_ifaddr *ia6;
        int s, error;
 
-       s = splnet();
+       NET_LOCK(s);
 
        ia6 = in6ifa_ifpforlinklocal(ifp, 0);
        if (ia6 == NULL) {
                /* IPv6 disabled? */
-               splx(s);
-               return;
+               goto out;
        }
 
        /* 
@@ -4381,8 +4380,7 @@ sppp_update_ip6_addr(void *arg)
                        log(LOG_ERR, SPP_FMT
                            "could not update IPv6 address (error %d)\n",
                            SPP_ARGS(ifp), error);
-               splx(s);
-               return;
+               goto out;
        }
 
        /* 
@@ -4403,7 +4401,8 @@ sppp_update_ip6_addr(void *arg)
                    "could not update IPv6 address (error %d)\n",
                    SPP_ARGS(ifp), error);
        }
-       splx(s);
+out:
+       NET_UNLOCK(s);
 }
 
 /*

Reply via email to