Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 May 2017 18:41:24 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r318255 - in head/sys: netinet netinet6
Message-ID:  <201705131841.v4DIfOnH078151@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Sat May 13 18:41:24 2017
New Revision: 318255
URL: https://svnweb.freebsd.org/changeset/base/318255

Log:
  Add missing braces around MCAST_EXCLUDE check when KTR support is
  compiled into the kernel
  
  This ensures that .iss_asm (the number of ASM listeners) isn't incorrectly
  decremented for MLD-layer source datagrams when inspecting im*s_st[1]
  (the second state in the structure).
  
  MFC after:	2 months
  PR:		217509 [1]
  Reported by:	Coverity (Isilon)
  Reviewed by:	ae ("This patch looks correct to me." [1])
  Submitted by:	Miles Ohlrich <miles.ohlrich@isilon.com>
  Sponsored by:	Dell EMC Isilon

Modified:
  head/sys/netinet/in_mcast.c
  head/sys/netinet6/in6_mcast.c

Modified: head/sys/netinet/in_mcast.c
==============================================================================
--- head/sys/netinet/in_mcast.c	Sat May 13 17:49:53 2017	(r318254)
+++ head/sys/netinet/in_mcast.c	Sat May 13 18:41:24 2017	(r318255)
@@ -1047,9 +1047,10 @@ inm_merge(struct in_multi *inm, /*const*
 	/* Decrement ASM listener count on transition out of ASM mode. */
 	if (imf->imf_st[0] == MCAST_EXCLUDE && nsrc0 == 0) {
 		if ((imf->imf_st[1] != MCAST_EXCLUDE) ||
-		    (imf->imf_st[1] == MCAST_EXCLUDE && nsrc1 > 0))
+		    (imf->imf_st[1] == MCAST_EXCLUDE && nsrc1 > 0)) {
 			CTR1(KTR_IGMPV3, "%s: --asm on inm at t1", __func__);
 			--inm->inm_st[1].iss_asm;
+		}
 	}
 
 	/* Increment ASM listener count on transition to ASM mode. */

Modified: head/sys/netinet6/in6_mcast.c
==============================================================================
--- head/sys/netinet6/in6_mcast.c	Sat May 13 17:49:53 2017	(r318254)
+++ head/sys/netinet6/in6_mcast.c	Sat May 13 18:41:24 2017	(r318255)
@@ -999,9 +999,10 @@ in6m_merge(struct in6_multi *inm, /*cons
 	/* Decrement ASM listener count on transition out of ASM mode. */
 	if (imf->im6f_st[0] == MCAST_EXCLUDE && nsrc0 == 0) {
 		if ((imf->im6f_st[1] != MCAST_EXCLUDE) ||
-		    (imf->im6f_st[1] == MCAST_EXCLUDE && nsrc1 > 0))
+		    (imf->im6f_st[1] == MCAST_EXCLUDE && nsrc1 > 0)) {
 			CTR1(KTR_MLD, "%s: --asm on inm at t1", __func__);
 			--inm->in6m_st[1].iss_asm;
+		}
 	}
 
 	/* Increment ASM listener count on transition to ASM mode. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705131841.v4DIfOnH078151>