aboutsummaryrefslogtreecommitdiff
path: root/net/ipv4/arp.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-13 12:21:07 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-13 12:21:07 -0800
commit323a72d83c9b2963bd1e46c8e6963e468d4658d7 (patch)
treec607985a8c02ed49add9c7a85eabcb8acd3e8e37 /net/ipv4/arp.c
parent42976ad0b26b2465f33c9a9146eb15f3a644d269 (diff)
parent3bdb1a443a53a4058b95c8a67c856cc8b8393411 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "This is primarily to get those r8169 reverts sorted, but other fixes have accumulated meanwhile. 1) Revert two r8169 changes to fix suspend/resume for some users, from Francois Romieu. 2) PCI dma mapping errors in atl1c are not checked for and this cause hard crashes for some users, from Xiong Huang. 3) In 3.8.x we merged the removal of the EXPERIMENTAL dependency for 'dlm' but the same patch for 'sctp' got lost somewhere, resulting in the potential for build errors since there are cross dependencies. From Kees Cook. 4) SCTP's ipv6 socket route validation makes boolean tests incorrectly, fix from Daniel Borkmann. 5) mac80211 does sizeof(ptr) instead of (sizeof(ptr) * nelem), from Cong Ding. 6) arp_rcv() can crash on shared non-linear packets, from Eric Dumazet. 7) Avoid crashes in macvtap by setting ->gso_type consistently in ixgbe, qlcnic, and bnx2x drivers. From Michael S Tsirkin and Alexander Duyck. 8) Trinity fuzzer spots infinite loop in __skb_recv_datagram(), fix from Eric Dumazet. 9) STP protocol frames should use high packet priority, otherwise an overloaded bridge can get stuck. From Stephen Hemminger. 10) The HTB packet scheduler was converted some time ago to store internal timestamps in nanoseconds, but we don't convert back into psched ticks for the user during dumps. Fix from Jiri Pirko. 11) mwl8k channel table doesn't set the .band field properly, resulting in NULL pointer derefs. Fix from Jonas Gorski. 12) mac80211 doesn't accumulate channels properly during a scan so we can downgrade heavily to a much less desirable connection speed. Fix from Johannes Berg. 13) PHY probe failure in stmmac can result in resource leaks and double MDIO registery later, from Giuseppe CAVALLARO. 14) Correct ipv6 checksumming in ip6t_NPT netfilter module, also fix address prefix mangling, from YOSHIFUJI Hideaki." * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (27 commits) net, sctp: remove CONFIG_EXPERIMENTAL net: sctp: sctp_v6_get_dst: fix boolean test in dst cache batman-adv: Fix NULL pointer dereference in DAT hash collision avoidance net/macb: fix race with RX interrupt while doing NAPI atl1c: add error checking for pci_map_single functions htb: fix values in opt dump ixgbe: Only set gso_type to SKB_GSO_TCPV4 as RSC does not support IPv6 net: fix infinite loop in __skb_recv_datagram() net: qmi_wwan: add Yota / Megafon M100-1 4g modem mwl8k: fix band for supported channels bridge: set priority of STP packets mac80211: fix channel selection bug arp: fix possible crash in arp_rcv() bnx2x: set gso_type qlcnic: set gso_type ixgbe: fix gso type stmmac: mdio register has to fail if the phy is not found stmmac: fix macro used for debugging the xmit Revert "r8169: enable internal ASPM and clock request settings". Revert "r8169: enable ALDPS for power saving". ...
Diffstat (limited to 'net/ipv4/arp.c')
-rw-r--r--net/ipv4/arp.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 9547a273b9e..ded146b217f 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -928,24 +928,25 @@ static void parp_redo(struct sk_buff *skb)
static int arp_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt, struct net_device *orig_dev)
{
- struct arphdr *arp;
+ const struct arphdr *arp;
+
+ if (dev->flags & IFF_NOARP ||
+ skb->pkt_type == PACKET_OTHERHOST ||
+ skb->pkt_type == PACKET_LOOPBACK)
+ goto freeskb;
+
+ skb = skb_share_check(skb, GFP_ATOMIC);
+ if (!skb)
+ goto out_of_mem;
/* ARP header, plus 2 device addresses, plus 2 IP addresses. */
if (!pskb_may_pull(skb, arp_hdr_len(dev)))
goto freeskb;
arp = arp_hdr(skb);
- if (arp->ar_hln != dev->addr_len ||
- dev->flags & IFF_NOARP ||
- skb->pkt_type == PACKET_OTHERHOST ||
- skb->pkt_type == PACKET_LOOPBACK ||
- arp->ar_pln != 4)
+ if (arp->ar_hln != dev->addr_len || arp->ar_pln != 4)
goto freeskb;
- skb = skb_share_check(skb, GFP_ATOMIC);
- if (skb == NULL)
- goto out_of_mem;
-
memset(NEIGH_CB(skb), 0, sizeof(struct neighbour_cb));
return NF_HOOK(NFPROTO_ARP, NF_ARP_IN, skb, dev, NULL, arp_process);