X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=net%2Fipv6%2Fip6_input.c;h=17eb48b8e329af87498a1482dd0cfc64dad83789;hb=3b23e665b68387f5ee7b21f7b75ceea4d9acae4a;hp=4e5c8615832c61d88034910422db16722151de05;hpb=cf816ecb533ab96b883dfdc0db174598b5b5c4d2;p=linux-2.6 diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c index 4e5c861583..17eb48b8e3 100644 --- a/net/ipv6/ip6_input.c +++ b/net/ipv6/ip6_input.c @@ -102,6 +102,15 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt if (hdr->version != 6) goto err; + /* + * RFC4291 2.5.3 + * A packet received on an interface with a destination address + * of loopback must be dropped. + */ + if (!(dev->flags & IFF_LOOPBACK) && + ipv6_addr_loopback(&hdr->daddr)) + goto err; + skb->transport_header = skb->network_header + sizeof(*hdr); IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr);