Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/sys/net Pull up following revision(s) (requested by knaka...



details:   https://anonhg.NetBSD.org/src/rev/cbbaaecafe61
branches:  netbsd-8
changeset: 434718:cbbaaecafe61
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Mar 08 13:22:25 2018 +0000

description:
Pull up following revision(s) (requested by knakahara in ticket #613):
        sys/net/if_pppoe.c: revision 1.130,1.134
        sys/net/if_spppsubr.c: revision 1.172,1.175,1.179
        sys/net/if_gif.c: revision 1.138,1.139

Mark callouts of pppoe(4) CALLOUT_MPSAFE. Suggested by ozaki-r@n.o.

fix non-diagnostic compilation

Fix spl leak.
        ifconfig gif0 create
        ifconfig gif0 destroy
        WARNING: SPL NOT LOWERED ON ...

Fix breaking character limit. Pointed out by ozaki-r@n.o, thanks.

Use m_freem instead of m_free. Otherwise we're leaking the next mbufs in
the chain.

diffstat:

 sys/net/if_gif.c      |   9 ++++++---
 sys/net/if_pppoe.c    |  12 ++++++------
 sys/net/if_spppsubr.c |  24 ++++++++++++------------
 3 files changed, 24 insertions(+), 21 deletions(-)

diffs (176 lines):

diff -r 912bf3b1bd2a -r cbbaaecafe61 sys/net/if_gif.c
--- a/sys/net/if_gif.c  Thu Mar 08 12:31:25 2018 +0000
+++ b/sys/net/if_gif.c  Thu Mar 08 13:22:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_gif.c,v 1.126.2.8 2018/02/11 21:17:34 snj Exp $     */
+/*     $NetBSD: if_gif.c,v 1.126.2.9 2018/03/08 13:22:26 martin Exp $  */
 /*     $KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $    */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.126.2.8 2018/02/11 21:17:34 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.126.2.9 2018/03/08 13:22:26 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -458,7 +458,7 @@
        IFQ_CLASSIFY(&ifp->if_snd, m, dst->sa_family);
 
        if ((error = gif_check_nesting(ifp, m)) != 0) {
-               m_free(m);
+               m_freem(m);
                goto end;
        }
 
@@ -1126,6 +1126,9 @@
                mutex_exit(&sc->gif_lock);
                encap_lock_exit();
                kmem_free(nvar, sizeof(*nvar));
+#ifndef GIF_MPSAFE
+               splx(s);
+#endif
                return;
        }
 
diff -r 912bf3b1bd2a -r cbbaaecafe61 sys/net/if_pppoe.c
--- a/sys/net/if_pppoe.c        Thu Mar 08 12:31:25 2018 +0000
+++ b/sys/net/if_pppoe.c        Thu Mar 08 13:22:25 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_pppoe.c,v 1.125.6.5 2018/01/02 10:20:33 snj Exp $ */
+/* $NetBSD: if_pppoe.c,v 1.125.6.6 2018/03/08 13:22:25 martin Exp $ */
 
 /*-
  * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.125.6.5 2018/01/02 10:20:33 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.125.6.6 2018/03/08 13:22:25 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "pppoe.h"
@@ -315,7 +315,7 @@
        /* changed to real address later */
        memcpy(&sc->sc_dest, etherbroadcastaddr, sizeof(sc->sc_dest));
 
-       callout_init(&sc->sc_timeout, 0);
+       callout_init(&sc->sc_timeout, CALLOUT_MPSAFE);
 
        sc->sc_sppp.pp_if.if_start = pppoe_start;
 #ifdef PPPOE_MPSAFE
@@ -1795,7 +1795,7 @@
        PPPOE_LOCK(sc, RW_READER);
        if (sc->sc_state < PPPOE_STATE_SESSION) {
                PPPOE_UNLOCK(sc);
-               m_free(m);
+               m_freem(m);
                return ENOBUFS;
        }
 
@@ -1887,13 +1887,13 @@
 pppoe_enqueue(struct ifqueue *inq, struct mbuf *m)
 {
        if (m->m_flags & M_PROMISC) {
-               m_free(m);
+               m_freem(m);
                return;
        }
 
 #ifndef PPPOE_SERVER
        if (m->m_flags & (M_MCAST | M_BCAST)) {
-               m_free(m);
+               m_freem(m);
                return;
        }
 #endif
diff -r 912bf3b1bd2a -r cbbaaecafe61 sys/net/if_spppsubr.c
--- a/sys/net/if_spppsubr.c     Thu Mar 08 12:31:25 2018 +0000
+++ b/sys/net/if_spppsubr.c     Thu Mar 08 13:22:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_spppsubr.c,v 1.169.6.4 2018/01/16 13:01:10 martin Exp $      */
+/*     $NetBSD: if_spppsubr.c,v 1.169.6.5 2018/03/08 13:22:25 martin Exp $      */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.169.6.4 2018/01/16 13:01:10 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.169.6.5 2018/03/08 13:22:25 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -999,7 +999,7 @@
 
        /* Initialize keepalive handler. */
        if (! spppq) {
-               callout_init(&keepalive_ch, 0);
+               callout_init(&keepalive_ch, CALLOUT_MPSAFE);
                callout_reset(&keepalive_ch, hz * LCP_KEEPALIVE_INTERVAL, sppp_keepalive, NULL);
        }
 
@@ -2205,7 +2205,7 @@
        sp->lcp.max_terminate = 2;
        sp->lcp.max_configure = 10;
        sp->lcp.max_failure = 10;
-       callout_init(&sp->ch[IDX_LCP], 0);
+       callout_init(&sp->ch[IDX_LCP], CALLOUT_MPSAFE);
 }
 
 static void
@@ -2967,9 +2967,9 @@
        sp->fail_counter[IDX_IPCP] = 0;
        sp->pp_seq[IDX_IPCP] = 0;
        sp->pp_rseq[IDX_IPCP] = 0;
-       callout_init(&sp->ch[IDX_IPCP], 0);
-
-       error = workqueue_create(&sp->ipcp.update_addrs_wq, "ipcp_update_addrs",
+       callout_init(&sp->ch[IDX_IPCP], CALLOUT_MPSAFE);
+
+       error = workqueue_create(&sp->ipcp.update_addrs_wq, "ipcp_addr",
            sppp_update_ip_addrs_work, sp, PRI_SOFTNET, IPL_NET, 0);
        if (error)
                panic("%s: update_addrs workqueue_create failed (%d)\n",
@@ -3526,7 +3526,7 @@
        sp->fail_counter[IDX_IPV6CP] = 0;
        sp->pp_seq[IDX_IPV6CP] = 0;
        sp->pp_rseq[IDX_IPV6CP] = 0;
-       callout_init(&sp->ch[IDX_IPV6CP], 0);
+       callout_init(&sp->ch[IDX_IPV6CP], CALLOUT_MPSAFE);
 }
 
 static void
@@ -4047,7 +4047,7 @@
 static void
 sppp_ipv6cp_TO(void *cookie)
 {
-       struct sppp *sp = cookie;
+       struct sppp *sp __diagused = cookie;
 
        KASSERT(SPPP_WLOCKED(sp));
 }
@@ -4464,7 +4464,7 @@
        sp->fail_counter[IDX_CHAP] = 0;
        sp->pp_seq[IDX_CHAP] = 0;
        sp->pp_rseq[IDX_CHAP] = 0;
-       callout_init(&sp->ch[IDX_CHAP], 0);
+       callout_init(&sp->ch[IDX_CHAP], CALLOUT_MPSAFE);
 }
 
 static void
@@ -4832,8 +4832,8 @@
        sp->fail_counter[IDX_PAP] = 0;
        sp->pp_seq[IDX_PAP] = 0;
        sp->pp_rseq[IDX_PAP] = 0;
-       callout_init(&sp->ch[IDX_PAP], 0);
-       callout_init(&sp->pap_my_to_ch, 0);
+       callout_init(&sp->ch[IDX_PAP], CALLOUT_MPSAFE);
+       callout_init(&sp->pap_my_to_ch, CALLOUT_MPSAFE);
 }
 
 static void



Home | Main Index | Thread Index | Old Index