aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6_input.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/ip6_input.c')
-rw-r--r--net/ipv6/ip6_input.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index f77a6011c302..34e5a96623ae 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -100,6 +100,15 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
100 if (hdr->version != 6) 100 if (hdr->version != 6)
101 goto err; 101 goto err;
102 102
103 /*
104 * RFC4291 2.5.3
105 * A packet received on an interface with a destination address
106 * of loopback must be dropped.
107 */
108 if (!(dev->flags & IFF_LOOPBACK) &&
109 ipv6_addr_loopback(&hdr->daddr))
110 goto err;
111
103 skb->transport_header = skb->network_header + sizeof(*hdr); 112 skb->transport_header = skb->network_header + sizeof(*hdr);
104 IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr); 113 IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr);
105 114