diff mbox

ipv4: use dst with ref during bcast/mcast loopback

Message ID alpine.LFD.2.00.1108072232170.13644@ja.ssi.bg
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Julian Anastasov Aug. 7, 2011, 8:17 p.m. UTC
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...

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller Aug. 8, 2011, 5:54 a.m. UTC | #1
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!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;
 }