Skip to contentSkip to conversation

netfilter: ipt_REJECT: avoid touching dst ref

PATCH Applied Eric Dumazet 2 participants 2 messages Jul 2, 2010 – Jul 5, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfilter: ipt_REJECT: avoid touching dst ref

We can avoid a pair of atomic ops in ipt_REJECT send_reset()

---

net/ipv4/netfilter/ipt_REJECT.c +1 -1
index f5f4a88..bbbd273 100644
@@ -109,7 +109,7 @@ static void send_reset(struct sk_buff *oldskb, int hook)
 		addr_type = RTN_LOCAL;
 
 	/* ip_route_me_harder expects skb->dst to be set */
-	skb_dst_set(nskb, dst_clone(skb_dst(oldskb)));
+	skb_dst_set_noref(nskb, skb_dst(oldskb));
 
 	if (ip_route_me_harder(nskb, addr_type))
 		goto free_nskb;
#1 lore raw
Quoted 2 lines · Eric Dumazet

We can avoid a pair of atomic ops in ipt_REJECT send_reset()

Applied, thanks.