I tested your change, no more messages in dmesg.

Thank you.

On 17 Oct 2016, at 22:52, Alexander Bluhm wrote:

> On Mon, Oct 17, 2016 at 08:56:09PM +0200, egorenar-...@posteo.net wrote:
>> i recently updated from 6.0  to a snapshot and
>> since then i see splassert sometimes in my dmesg when i use if_run USB
>> network device.
> ...
>> splassert_check() at splassert_check+0x78
>> sowakeup() at sowakeup+0x2c
>> sorwakeup() at sorwakeup+0x84
>> route_input() at route_input+0x284
>> run_attach() at run_attach+0x322
>
> This should fix it.
>
> ok?
>
> bluhm
>
> Index: net/rtsock.c
> ===================================================================
> RCS file: /data/mirror/openbsd/cvs/src/sys/net/rtsock.c,v
> retrieving revision 1.207
> diff -u -p -r1.207 rtsock.c
> --- net/rtsock.c      27 Sep 2016 18:41:11 -0000      1.207
> +++ net/rtsock.c      17 Oct 2016 20:46:47 -0000
> @@ -339,7 +339,7 @@ route_input(struct mbuf *m0, ...)
>       struct routecb *rop;
>       struct rt_msghdr *rtm;
>       struct mbuf *m = m0;
> -     int sockets = 0;
> +     int s, sockets = 0;
>       struct socket *last = NULL;
>       va_list ap;
>       struct sockproto *proto;
> @@ -419,6 +419,7 @@ route_input(struct mbuf *m0, ...)
>               if (last) {
>                       struct mbuf *n;
>                       if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) != NULL) {
> +                             s = splsoftnet();
>                               if (sbspace(&last->so_rcv) < (2 * MSIZE) ||
>                                   sbappendaddr(&last->so_rcv, sosrc,
>                                   n, (struct mbuf *)NULL) == 0) {
> @@ -435,11 +436,13 @@ route_input(struct mbuf *m0, ...)
>                                       sorwakeup(last);
>                                       sockets++;
>                               }
> +                             splx(s);
>                       }
>               }
>               last = rp->rcb_socket;
>       }
>       if (last) {
> +             s = splsoftnet();
>               if (sbspace(&last->so_rcv) < (2 * MSIZE) ||
>                   sbappendaddr(&last->so_rcv, sosrc,
>                   m, (struct mbuf *)NULL) == 0) {
> @@ -452,6 +455,7 @@ route_input(struct mbuf *m0, ...)
>                       sorwakeup(last);
>                       sockets++;
>               }
> +             splx(s);
>       } else
>               m_freem(m);
>  }
>

Reply via email to