On 15.09.2014 14:56, Gleb Smirnoff wrote:
> On Sat, Sep 13, 2014 at 06:13:08PM +0000, Alexander V. Chernikov wrote:
> A> @@ -1099,15 +1117,39 @@ vlan_transmit(struct ifnet *ifp, struct 
> A>     * Send it, precisely as ether_output() would have.
> A>     */
> A>    error = (p->if_transmit)(p, m);
> A> -  if (!error) {
> A> -          ifp->if_opackets++;
> A> -          ifp->if_omcasts += mcast;
> A> -          ifp->if_obytes += len;
> A> +  if (error == 0) {
> A> +          counter_u64_add(ifv->ifv_opackets, 1);
> A> +          counter_u64_add(ifv->ifv_obytes, len);
> A> +          counter_u64_add(ifv->ifv_omcasts, 1);
> A>    } else
> A>            ifp->if_oerrors++;
> A>    return (error);
> A>  }
> 
> This looks like counting all packets as multicasts. Strange that compiler
> didn't warn you about write only variable.
Unfortunately, clang does not warn about this kind of thing.
> 
> P.S. Why did you decide to keep if_oerrors old style?
Id had a stong feeling that oerrors is used both by drivers and stack.
It looks like this is not the case.

I've committed both changes in r271691.
> 

_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to