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  linux-hardening  linux-cve-announce  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, 30 May 2019 11:08:40 -0700
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     Davide Caratti <dcaratti@...hat.com>
Cc:     Eric Dumazet <eric.dumazet@...il.com>,
        Cong Wang <xiyou.wangcong@...il.com>,
        Jiri Pirko <jiri@...nulli.us>,
        Jamal Hadi Salim <jhs@...atatu.com>,
        "David S . Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
        shuali@...hat.com, Eli Britstein <elibr@...lanox.com>
Subject: Re: [PATCH net v2 1/3] net/sched: act_csum: pull all VLAN headers
 before checksumming

On Thu, 30 May 2019 20:03:41 +0200
Davide Caratti <dcaratti@...hat.com> wrote:

>  
> +static inline int tc_skb_pull_vlans(struct sk_buff *skb,
> +				    unsigned int *hdr_count,
> +				    __be16 *proto)
> +{
> +	if (skb_vlan_tag_present(skb))
> +		*proto = skb->protocol;
> +
> +	while (eth_type_vlan(*proto)) {
> +		struct vlan_hdr *vlan;
> +
> +		if (unlikely(!pskb_may_pull(skb, VLAN_HLEN)))
> +			return -ENOMEM;
> +
> +		vlan = (struct vlan_hdr *)skb->data;
> +		*proto = vlan->h_vlan_encapsulated_proto;
> +		skb_pull(skb, VLAN_HLEN);
> +		skb_reset_network_header(skb);
> +		(*hdr_count)++;
> +	}
> +	return 0;
> +}

Does this really need to be an inline, or could it just be
part of the sched_api?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ