Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet Keep a pointer to the interface of the multicast...



details:   https://anonhg.NetBSD.org/src/rev/69e76aa8e74e
branches:  trunk
changeset: 829787:69e76aa8e74e
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Feb 12 18:19:12 2018 +0000

description:
Keep a pointer to the interface of the multicast membership, because the
multicast element itself might go away in in_delmulti (but the interface
can't because we hold the lock). From ozaki-r@

diffstat:

 sys/netinet/ip_output.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r 6f7470e9392d -r 69e76aa8e74e sys/netinet/ip_output.c
--- a/sys/netinet/ip_output.c   Mon Feb 12 17:04:58 2018 +0000
+++ b/sys/netinet/ip_output.c   Mon Feb 12 18:19:12 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_output.c,v 1.294 2018/02/07 06:21:23 mrg Exp $      */
+/*     $NetBSD: ip_output.c,v 1.295 2018/02/12 18:19:12 christos Exp $ */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.294 2018/02/07 06:21:23 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.295 2018/02/12 18:19:12 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1927,9 +1927,10 @@
         * Give up the multicast address record to which the
         * membership points.
         */
-       IFNET_LOCK(imo->imo_membership[i]->inm_ifp);
+       struct ifnet *inm_ifp = imo->imo_membership[i]->inm_ifp;
+       IFNET_LOCK(inm_ifp);
        in_delmulti(imo->imo_membership[i]);
-       IFNET_UNLOCK(imo->imo_membership[i]->inm_ifp);
+       IFNET_UNLOCK(inm_ifp);
 
        /*
         * Remove the gap in the membership array.



Home | Main Index | Thread Index | Old Index