For a long time ip_ours() and ip6_ours() are calling ip_deliver()
authorbluhm <bluhm@openbsd.org>
Sat, 25 Dec 2021 13:35:17 +0000 (13:35 +0000)
committerbluhm <bluhm@openbsd.org>
Sat, 25 Dec 2021 13:35:17 +0000 (13:35 +0000)
without kernel lock.  Unlock the two callers in ip6_input_if() that
have been forgotten.
OK mvs@ kn@

sys/netinet6/ip6_input.c

index 4ddc3e9..142477d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ip6_input.c,v 1.237 2021/06/03 04:47:54 dlg Exp $     */
+/*     $OpenBSD: ip6_input.c,v 1.238 2021/12/25 13:35:17 bluhm Exp $   */
 /*     $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $     */
 
 /*
@@ -404,12 +404,9 @@ ip6_input_if(struct mbuf **mp, int *offp, int nxt, int af, struct ifnet *ifp)
                        }
 
                        if (ours) {
-                               if (af == AF_UNSPEC) {
-                                       KERNEL_LOCK();
+                               if (af == AF_UNSPEC)
                                        nxt = ip_deliver(mp, offp, nxt,
                                            AF_INET6);
-                                       KERNEL_UNLOCK();
-                               }
                                goto out;
                        }
                        goto bad;
@@ -508,11 +505,8 @@ ip6_input_if(struct mbuf **mp, int *offp, int nxt, int af, struct ifnet *ifp)
                goto out;
 
        if (ours) {
-               if (af == AF_UNSPEC) {
-                       KERNEL_LOCK();
+               if (af == AF_UNSPEC)
                        nxt = ip_deliver(mp, offp, nxt, AF_INET6);
-                       KERNEL_UNLOCK();
-               }
                goto out;
        }