blob: c27d10ea87c13b286d0f187e66c657545235b8c4 [file] [log] [blame]
From 6140aa059245f37877171b62a372c412f33c4ba2 Mon Sep 17 00:00:00 2001
From: Lorenz Bauer <>
Date: Fri, 13 Dec 2019 18:08:17 +0000
Subject: [PATCH] bpf: Clear skb->tstamp in bpf_redirect when necessary
commit 5133498f4ad1123a5ffd4c08df6431dab882cc32 upstream.
Redirecting a packet from ingress to egress by using bpf_redirect
breaks if the egress interface has an fq qdisc installed. This is the same
problem as fixed in 'commit 8203e2d844d3 ("net: clear skb->tstamp in forwarding paths")
Clear skb->tstamp when redirecting into the egress path.
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: Lorenz Bauer <>
Signed-off-by: Alexei Starovoitov <>
Reviewed-by: Eric Dumazet <>
Signed-off-by: Paul Gortmaker <>
diff --git a/net/core/filter.c b/net/core/filter.c
index 82e0af0f221b..7acc2bd95f39 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -2054,6 +2054,7 @@ static inline int __bpf_tx_skb(struct net_device *dev, struct sk_buff *skb)
skb->dev = dev;
+ skb->tstamp = 0;
ret = dev_queue_xmit(skb);