Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 May 2018 14:14:56 +0000 (UTC)
From:      Eric van Gyzen <vangyzen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r334239 - head/sys/dev/hyperv/netvsc
Message-ID:  <201805261414.w4QEEuBf004212@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: vangyzen
Date: Sat May 26 14:14:56 2018
New Revision: 334239
URL: https://svnweb.freebsd.org/changeset/base/334239

Log:
  if_hn: fix use of uninitialized variable
  
  omcast was used without being initialized in the non-multicast case.
  The only effect was that the interface's multicast output counter could be
  incorrect.
  
  Reported by:	Coverity
  CID:		1379662
  MFC after:	3 days
  Sponsored by:	Dell EMC

Modified:
  head/sys/dev/hyperv/netvsc/if_hn.c

Modified: head/sys/dev/hyperv/netvsc/if_hn.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/if_hn.c	Sat May 26 14:01:44 2018	(r334238)
+++ head/sys/dev/hyperv/netvsc/if_hn.c	Sat May 26 14:14:56 2018	(r334239)
@@ -5939,8 +5939,7 @@ hn_transmit(struct ifnet *ifp, struct mbuf *m)
 			int obytes, omcast;
 
 			obytes = m->m_pkthdr.len;
-			if (m->m_flags & M_MCAST)
-				omcast = 1;
+			omcast = (m->m_flags & M_MCAST) != 0;
 
 			if (sc->hn_xvf_flags & HN_XVFFLAG_ACCBPF) {
 				if (bpf_peers_present(ifp->if_bpf)) {



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