fix a kernel bug where IPv6 packets are received on IPv4 sockets, this fixes dual...
[openwrt/staging/mkresin.git] / target / linux / brcm-2.4 / patches / 200-fix_ipv6_receiving_with_ipv4_socket.patch
1 --- a/net/ipv4/udp.c 2009-12-26 00:06:59.000000000 +0100
2 +++ b/net/ipv4/udp.c 2009-12-27 00:27:05.003012266 +0100
3 @@ -711,7 +711,14 @@
4 skb = skb_recv_datagram(sk, flags, noblock, &err);
5 if (!skb)
6 goto out;
7 -
8 +
9 + if (skb->nh.iph->version != 4) {
10 + skb_free_datagram(sk, skb);
11 + if (noblock)
12 + return -EAGAIN;
13 + goto try_again;
14 + }
15 +
16 copied = skb->len - sizeof(struct udphdr);
17 if (copied > len) {
18 copied = len;