net: clear skb->tstamp in forwarding paths
Subsystems (3)
PATCH 1/1 net: clear skb->tstamp in forwarding paths
Sergey reported that forwarding was no longer working if fq packet scheduler was used.
This is caused by the recent switch to EDT model, since incoming packets might have been timestamped by __net_timestamp()
__net_timestamp() uses ktime_get_real(), while fq expects packets using CLOCK_MONOTONIC base.
The fix is to clear skb->tstamp in forwarding paths.
--- net/ipv4/ip_forward.c | 1 + net/ipv6/ip6_output.c | 1 + 2 files changed, 2 insertions(+)
net/ipv4/ip_forward.c +1 -0
@@ -72,6 +72,7 @@ static int ip_forward_finish(struct net *net, struct sock *sk, struct sk_buff *sif (unlikely (opt->optlen))ip_forward_options (skb); + skb->tstamp =0 ;return dst_output (net, sk, skb); }
net/ipv6/ip6_output.c +1 -0
@@ -378,6 +378,7 @@ static inline int ip6_forward_finish(struct net *net, struct sock *sk,__IP6_INC_STATS (net,ip6_dst_idev (dst),IPSTATS_MIB_OUTFORWDATAGRAMS );__IP6_ADD_STATS (net,ip6_dst_idev (dst),IPSTATS_MIB_OUTOCTETS , skb->len); + skb->tstamp =0 ;return dst_output (net, sk, skb); }
Signature · 1 line
2.20.0.405.gbc1bbc6f85-goog
David Miller
maintainerFrom: Eric Dumazet <[email protected]>
Date: Fri, 14 Dec 2018 06:46:49 -0800
Quoted 9 lines
Sergey reported that forwarding was no longer working if fq packet scheduler was used.
This is caused by the recent switch to EDT model, since incoming packets might have been timestamped by
__net_timestamp()
__net_timestamp()usesktime_get_real(), while fq expects packets usingCLOCK_MONOTONICbase.
Quoted 7 lines
The fix is to clear
skb->tstampin forwarding paths.Fixes 80b14dee2bea ("net: Add a new socket option for a future transmit time.")Fixes fb420d5d91c1 ("tcp/fq: move back to CLOCK_MONOTONIC")Signed-off-by Eric Dumazet <[email protected]>Reported-by Sergey Matyukevich <[email protected]>Tested-by Sergey Matyukevich <[email protected]>
Applied and queued up for -stable, thanks Eric.