diff options
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/mcast.c | 13 | ||||
-rw-r--r-- | net/ipv6/udp.c | 6 |
2 files changed, 16 insertions, 3 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 08b367c6b9cf..617f0958e164 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -1301,8 +1301,17 @@ int igmp6_event_query(struct sk_buff *skb) | |||
1301 | len = ntohs(ipv6_hdr(skb)->payload_len) + sizeof(struct ipv6hdr); | 1301 | len = ntohs(ipv6_hdr(skb)->payload_len) + sizeof(struct ipv6hdr); |
1302 | len -= skb_network_header_len(skb); | 1302 | len -= skb_network_header_len(skb); |
1303 | 1303 | ||
1304 | /* Drop queries with not link local source */ | 1304 | /* RFC3810 6.2 |
1305 | if (!(ipv6_addr_type(&ipv6_hdr(skb)->saddr) & IPV6_ADDR_LINKLOCAL)) | 1305 | * Upon reception of an MLD message that contains a Query, the node |
1306 | * checks if the source address of the message is a valid link-local | ||
1307 | * address, if the Hop Limit is set to 1, and if the Router Alert | ||
1308 | * option is present in the Hop-By-Hop Options header of the IPv6 | ||
1309 | * packet. If any of these checks fails, the packet is dropped. | ||
1310 | */ | ||
1311 | if (!(ipv6_addr_type(&ipv6_hdr(skb)->saddr) & IPV6_ADDR_LINKLOCAL) || | ||
1312 | ipv6_hdr(skb)->hop_limit != 1 || | ||
1313 | !(IP6CB(skb)->flags & IP6SKB_ROUTERALERT) || | ||
1314 | IP6CB(skb)->ra != htons(IPV6_OPT_ROUTERALERT_MLD)) | ||
1306 | return -EINVAL; | 1315 | return -EINVAL; |
1307 | 1316 | ||
1308 | idev = __in6_dev_get(skb->dev); | 1317 | idev = __in6_dev_get(skb->dev); |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index c2bd28fd43e4..b4481df3d5fa 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -673,8 +673,11 @@ int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | |||
673 | goto csum_error; | 673 | goto csum_error; |
674 | } | 674 | } |
675 | 675 | ||
676 | if (sk_rcvqueues_full(sk, skb, sk->sk_rcvbuf)) | 676 | if (sk_rcvqueues_full(sk, skb, sk->sk_rcvbuf)) { |
677 | UDP6_INC_STATS_BH(sock_net(sk), | ||
678 | UDP_MIB_RCVBUFERRORS, is_udplite); | ||
677 | goto drop; | 679 | goto drop; |
680 | } | ||
678 | 681 | ||
679 | skb_dst_drop(skb); | 682 | skb_dst_drop(skb); |
680 | 683 | ||
@@ -689,6 +692,7 @@ int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | |||
689 | bh_unlock_sock(sk); | 692 | bh_unlock_sock(sk); |
690 | 693 | ||
691 | return rc; | 694 | return rc; |
695 | |||
692 | csum_error: | 696 | csum_error: |
693 | UDP6_INC_STATS_BH(sock_net(sk), UDP_MIB_CSUMERRORS, is_udplite); | 697 | UDP6_INC_STATS_BH(sock_net(sk), UDP_MIB_CSUMERRORS, is_udplite); |
694 | drop: | 698 | drop: |