[PATCH] ipv4: use dst with ref during bcast/mcast loopback

STALE5547d

2 messages, 2 authors, 2011-08-08 · open the first message on its own page

[PATCH] ipv4: use dst with ref during bcast/mcast loopback

From: Julian Anastasov <ja@ssi.bg>
Date: 2011-08-07 20:12:41

	Make sure skb dst has reference when moving to
another context. Currently, I don't see protocols that can
hit it when sending broadcasts/multicasts to loopback using
noref dsts, so it is just a precaution.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
---

	Please, review and apply if needed...

diff -urp v3.0/linux/net/ipv4/ip_output.c linux/net/ipv4/ip_output.c
--- v3.0/linux/net/ipv4/ip_output.c	2011-07-22 09:43:32.000000000 +0300
+++ linux/net/ipv4/ip_output.c	2011-08-07 22:21:23.909347184 +0300
@@ -122,6 +122,7 @@ static int ip_dev_loopback_xmit(struct s
 	newskb->pkt_type = PACKET_LOOPBACK;
 	newskb->ip_summed = CHECKSUM_UNNECESSARY;
 	WARN_ON(!skb_dst(newskb));
+	skb_dst_force(newskb);
 	netif_rx_ni(newskb);
 	return 0;
 }

Re: [PATCH] ipv4: use dst with ref during bcast/mcast loopback

From: David Miller <davem@davemloft.net>
Date: 2011-08-08 05:54:17

From: Julian Anastasov <ja@ssi.bg>
Date: Sun, 7 Aug 2011 23:17:22 +0300 (EEST)
	Make sure skb dst has reference when moving to
another context. Currently, I don't see protocols that can
hit it when sending broadcasts/multicasts to loopback using
noref dsts, so it is just a precaution.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
---

	Please, review and apply if needed...
Better safe than sorry, applied, thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help