Skip to content

Commit 7236ead

Browse files
Eric Dumazetdavem330
authored andcommitted
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: fb420d5 ("tcp/fq: move back to CLOCK_MONOTONIC") Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a9049ff commit 7236ead

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

net/sched/act_mirred.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ static int tcf_mirred_act(struct sk_buff *skb, const struct tc_action *a,
258258
if (is_redirect) {
259259
skb2->tc_redirected = 1;
260260
skb2->tc_from_ingress = skb2->tc_at_ingress;
261-
261+
if (skb2->tc_from_ingress)
262+
skb2->tstamp = 0;
262263
/* let's the caller reinsert the packet, if possible */
263264
if (use_reinsert) {
264265
res->ingress = want_ingress;

net/sched/sch_netem.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -648,15 +648,6 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch)
648648
*/
649649
skb->dev = qdisc_dev(sch);
650650

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-
660651
if (q->slot.slot_next) {
661652
q->slot.packets_left--;
662653
q->slot.bytes_left -= qdisc_pkt_len(skb);

0 commit comments

Comments
 (0)