lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 24 Dec 2015 10:14:02 +0100
From:	Nicolas Dichtel <nicolas.dichtel@...nd.com>
To:	Pravin B Shelar <pshelar@...ira.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next v2] ip_tunnel: Move stats update to
 iptunnel_xmit()

Le 24/12/2015 00:52, Pravin B Shelar a écrit :
[snip]
> @@ -83,22 +84,12 @@ int ip6_tnl_get_iflink(const struct net_device *dev);
>   static inline void ip6tunnel_xmit(struct sock *sk, struct sk_buff *skb,
>   				  struct net_device *dev)
>   {
> -	struct net_device_stats *stats = &dev->stats;
>   	int pkt_len, err;
>
>   	pkt_len = skb->len - skb_inner_network_offset(skb);
>   	err = ip6_local_out(dev_net(skb_dst(skb)->dev), sk, skb);
> -
> -	if (net_xmit_eval(err) == 0) {
> -		struct pcpu_sw_netstats *tstats = get_cpu_ptr(dev->tstats);
> -		u64_stats_update_begin(&tstats->syncp);
> -		tstats->tx_bytes += pkt_len;
> -		tstats->tx_packets++;
> -		u64_stats_update_end(&tstats->syncp);
> -		put_cpu_ptr(tstats);
> -	} else {
> -		stats->tx_errors++;
> -		stats->tx_aborted_errors++;
> -	}
> +	if (likely(!net_xmit_eval(err)))
> +		err = pkt_len;
> +	iptunnel_xmit_stats(dev, err);
I don't think this is an equivalent change.
For example, if err == NET_XMIT_DROP, then '!net_xmit_eval(err)' is false and
iptunnel_xmit_stats() is called with err set to a positive value (NET_XMIT_DROP
value is 0x01), ie not an error.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists