On 03/11/2019 08:14 AM, Olga Albisser wrote:
> +
> +static u32 get_ecn_field(struct sk_buff *skb)
> +{
> + switch (skb->protocol) {
tc_skb_protocol(skb)
> + case cpu_to_be16(ETH_P_IP):
Theoretically you have to use pskb_may_pull() before assuming network header is
in the linear part of skb (skb->head)
> + return ipv4_get_dsfield(ip_hdr(skb)) & INET_ECN_MASK;
> + case cpu_to_be16(ETH_P_IPV6):
> + return ipv6_get_dsfield(ipv6_hdr(skb)) & INET_ECN_MASK;
> + default:
> + return 0;
> + }
> +}
>
- [PATCH net-next] sched: add dualpi2 ... Olga Albisser
- Re: [PATCH net-next] sched: add... Eric Dumazet
- Re: [PATCH net-next] sched:... Eric Dumazet
- Re: [PATCH net-next] sched: add... Eric Dumazet
- Re: [PATCH net-next] sched:... Eric Dumazet
- Re: [PATCH net-next] sched: add... kbuild test robot
- Re: [PATCH net-next] sched: add... Toke Høiland-Jørgensen
- RE: [PATCH net-next] sched:... Tilmans, Olivier (Nokia - BE/Antwerp)
- RE: [PATCH net-next] sc... Toke Høiland-Jørgensen
