|
@@ -102,6 +102,15 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
|
|
if (hdr->version != 6)
|
|
if (hdr->version != 6)
|
|
goto err;
|
|
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);
|
|
skb->transport_header = skb->network_header + sizeof(*hdr);
|
|
IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr);
|
|
IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr);
|
|
|
|
|