diff options
Diffstat (limited to 'net/ipv6/ip6_input.c')
-rw-r--r-- | net/ipv6/ip6_input.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c index 9075acf081dd..c05c425c2389 100644 --- a/net/ipv6/ip6_input.c +++ b/net/ipv6/ip6_input.c | |||
@@ -49,7 +49,7 @@ | |||
49 | 49 | ||
50 | int ip6_rcv_finish(struct net *net, struct sock *sk, struct sk_buff *skb) | 50 | int ip6_rcv_finish(struct net *net, struct sock *sk, struct sk_buff *skb) |
51 | { | 51 | { |
52 | if (sysctl_ip_early_demux && !skb_dst(skb) && skb->sk == NULL) { | 52 | if (net->ipv4.sysctl_ip_early_demux && !skb_dst(skb) && skb->sk == NULL) { |
53 | const struct inet6_protocol *ipprot; | 53 | const struct inet6_protocol *ipprot; |
54 | 54 | ||
55 | ipprot = rcu_dereference(inet6_protos[ipv6_hdr(skb)->nexthdr]); | 55 | ipprot = rcu_dereference(inet6_protos[ipv6_hdr(skb)->nexthdr]); |
@@ -134,6 +134,16 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt | |||
134 | IPV6_ADDR_MC_SCOPE(&hdr->daddr) == 1) | 134 | IPV6_ADDR_MC_SCOPE(&hdr->daddr) == 1) |
135 | goto err; | 135 | goto err; |
136 | 136 | ||
137 | /* If enabled, drop unicast packets that were encapsulated in link-layer | ||
138 | * multicast or broadcast to protected against the so-called "hole-196" | ||
139 | * attack in 802.11 wireless. | ||
140 | */ | ||
141 | if (!ipv6_addr_is_multicast(&hdr->daddr) && | ||
142 | (skb->pkt_type == PACKET_BROADCAST || | ||
143 | skb->pkt_type == PACKET_MULTICAST) && | ||
144 | idev->cnf.drop_unicast_in_l2_multicast) | ||
145 | goto err; | ||
146 | |||
137 | /* RFC4291 2.7 | 147 | /* RFC4291 2.7 |
138 | * Nodes must not originate a packet to a multicast address whose scope | 148 | * Nodes must not originate a packet to a multicast address whose scope |
139 | * field contains the reserved value 0; if such a packet is received, it | 149 | * field contains the reserved value 0; if such a packet is received, it |