diff options
| author | Eric Dumazet <edumazet@google.com> | 2018-11-10 19:22:29 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2018-11-11 13:21:31 -0500 |
| commit | 7236ead1b14923f3ba35cd29cce13246be83f451 (patch) | |
| tree | 7e111a6aa40a9e3b196b7a9570dbba98edee6843 | |
| parent | a9049ff9214da68df1179a7d5e36b43479abc9b8 (diff) | |
act_mirred: clear skb->tstamp on redirect
If sch_fq is used at ingress, skbs that might have been
timestamped by net_timestamp_set() if a packet capture
is requesting timestamps could be delayed by arbitrary
amount of time, since sch_fq time base is MONOTONIC.
Fix this problem by moving code from sch_netem.c to act_mirred.c.
Fixes: fb420d5d91c1 ("tcp/fq: move back to CLOCK_MONOTONIC")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | net/sched/act_mirred.c | 3 | ||||
| -rw-r--r-- | net/sched/sch_netem.c | 9 |
2 files changed, 2 insertions, 10 deletions
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index 1dae5f2b358f..c8cf4d10c435 100644 --- a/net/sched/act_mirred.c +++ b/net/sched/act_mirred.c | |||
| @@ -258,7 +258,8 @@ static int tcf_mirred_act(struct sk_buff *skb, const struct tc_action *a, | |||
| 258 | if (is_redirect) { | 258 | if (is_redirect) { |
| 259 | skb2->tc_redirected = 1; | 259 | skb2->tc_redirected = 1; |
| 260 | skb2->tc_from_ingress = skb2->tc_at_ingress; | 260 | skb2->tc_from_ingress = skb2->tc_at_ingress; |
| 261 | 261 | if (skb2->tc_from_ingress) | |
| 262 | skb2->tstamp = 0; | ||
| 262 | /* let's the caller reinsert the packet, if possible */ | 263 | /* let's the caller reinsert the packet, if possible */ |
| 263 | if (use_reinsert) { | 264 | if (use_reinsert) { |
| 264 | res->ingress = want_ingress; | 265 | res->ingress = want_ingress; |
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index 57b3ad9394ad..2c38e3d07924 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
| @@ -648,15 +648,6 @@ deliver: | |||
| 648 | */ | 648 | */ |
| 649 | skb->dev = qdisc_dev(sch); | 649 | skb->dev = qdisc_dev(sch); |
| 650 | 650 | ||
| 651 | #ifdef CONFIG_NET_CLS_ACT | ||
| 652 | /* | ||
| 653 | * If it's at ingress let's pretend the delay is | ||
| 654 | * from the network (tstamp will be updated). | ||
| 655 | */ | ||
| 656 | if (skb->tc_redirected && skb->tc_from_ingress) | ||
| 657 | skb->tstamp = 0; | ||
| 658 | #endif | ||
| 659 | |||
| 660 | if (q->slot.slot_next) { | 651 | if (q->slot.slot_next) { |
| 661 | q->slot.packets_left--; | 652 | q->slot.packets_left--; |
| 662 | q->slot.bytes_left -= qdisc_pkt_len(skb); | 653 | q->slot.bytes_left -= qdisc_pkt_len(skb); |
