* [PATCH] ipv6: drop packets when source address is multicast
@ 2011-11-08 14:41 Brian Haley
2011-11-08 17:37 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Brian Haley @ 2011-11-08 14:41 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Kumar Sanghvi
RFC 4291 Section 2.7 says Multicast addresses must not be used as source
addresses in IPv6 packets - drop them on input so we don't process the
packet further.
Signed-off-by: Brian Haley <brian.haley@hp.com>
Reported-and-Tested-by: Kumar Sanghvi <divinekumar@gmail.com>
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index 027c7ff..a46c64e 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -111,6 +111,14 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
ipv6_addr_loopback(&hdr->daddr))
goto err;
+ /*
+ * RFC4291 2.7
+ * Multicast addresses must not be used as source addresses in IPv6
+ * packets or appear in any Routing header.
+ */
+ if (ipv6_addr_is_multicast(&hdr->saddr))
+ goto err;
+
skb->transport_header = skb->network_header + sizeof(*hdr);
IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ipv6: drop packets when source address is multicast
2011-11-08 14:41 [PATCH] ipv6: drop packets when source address is multicast Brian Haley
@ 2011-11-08 17:37 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-11-08 17:37 UTC (permalink / raw)
To: brian.haley; +Cc: netdev, divinekumar
From: Brian Haley <brian.haley@hp.com>
Date: Tue, 08 Nov 2011 09:41:42 -0500
> RFC 4291 Section 2.7 says Multicast addresses must not be used as source
> addresses in IPv6 packets - drop them on input so we don't process the
> packet further.
>
> Signed-off-by: Brian Haley <brian.haley@hp.com>
> Reported-and-Tested-by: Kumar Sanghvi <divinekumar@gmail.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-08 17:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-08 14:41 [PATCH] ipv6: drop packets when source address is multicast Brian Haley
2011-11-08 17:37 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).