diff options
author | David S. Miller <davem@davemloft.net> | 2015-09-26 19:08:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-09-26 19:08:27 -0400 |
commit | 4963ed48f2c20196d51a447ee87dc2815584fee4 (patch) | |
tree | a1902f466dafa00453889a4f1e66b00249ce0529 /net/ipv4/arp.c | |
parent | 4d54d86546f62c7c4a0fe3b36a64c5e3b98ce1a9 (diff) | |
parent | 518a7cb6980cd640c7f979d29021ad870f60d7d7 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
net/ipv4/arp.c
The net/ipv4/arp.c conflict was one commit adding a new
local variable while another commit was deleting one.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/arp.c')
-rw-r--r-- | net/ipv4/arp.c | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 61ff5ea31283..01308e6e6127 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -113,6 +113,8 @@ | |||
113 | #include <net/arp.h> | 113 | #include <net/arp.h> |
114 | #include <net/ax25.h> | 114 | #include <net/ax25.h> |
115 | #include <net/netrom.h> | 115 | #include <net/netrom.h> |
116 | #include <net/dst_metadata.h> | ||
117 | #include <net/ip_tunnels.h> | ||
116 | 118 | ||
117 | #include <linux/uaccess.h> | 119 | #include <linux/uaccess.h> |
118 | 120 | ||
@@ -296,7 +298,8 @@ static void arp_send_dst(int type, int ptype, __be32 dest_ip, | |||
296 | struct net_device *dev, __be32 src_ip, | 298 | struct net_device *dev, __be32 src_ip, |
297 | const unsigned char *dest_hw, | 299 | const unsigned char *dest_hw, |
298 | const unsigned char *src_hw, | 300 | const unsigned char *src_hw, |
299 | const unsigned char *target_hw, struct sk_buff *oskb) | 301 | const unsigned char *target_hw, |
302 | struct dst_entry *dst) | ||
300 | { | 303 | { |
301 | struct sk_buff *skb; | 304 | struct sk_buff *skb; |
302 | 305 | ||
@@ -309,9 +312,7 @@ static void arp_send_dst(int type, int ptype, __be32 dest_ip, | |||
309 | if (!skb) | 312 | if (!skb) |
310 | return; | 313 | return; |
311 | 314 | ||
312 | if (oskb) | 315 | skb_dst_set(skb, dst); |
313 | skb_dst_copy(skb, oskb); | ||
314 | |||
315 | arp_xmit(skb); | 316 | arp_xmit(skb); |
316 | } | 317 | } |
317 | 318 | ||
@@ -333,6 +334,7 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb) | |||
333 | __be32 target = *(__be32 *)neigh->primary_key; | 334 | __be32 target = *(__be32 *)neigh->primary_key; |
334 | int probes = atomic_read(&neigh->probes); | 335 | int probes = atomic_read(&neigh->probes); |
335 | struct in_device *in_dev; | 336 | struct in_device *in_dev; |
337 | struct dst_entry *dst = NULL; | ||
336 | 338 | ||
337 | rcu_read_lock(); | 339 | rcu_read_lock(); |
338 | in_dev = __in_dev_get_rcu(dev); | 340 | in_dev = __in_dev_get_rcu(dev); |
@@ -381,9 +383,10 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb) | |||
381 | } | 383 | } |
382 | } | 384 | } |
383 | 385 | ||
386 | if (skb && !(dev->priv_flags & IFF_XMIT_DST_RELEASE)) | ||
387 | dst = dst_clone(skb_dst(skb)); | ||
384 | arp_send_dst(ARPOP_REQUEST, ETH_P_ARP, target, dev, saddr, | 388 | arp_send_dst(ARPOP_REQUEST, ETH_P_ARP, target, dev, saddr, |
385 | dst_hw, dev->dev_addr, NULL, | 389 | dst_hw, dev->dev_addr, NULL, dst); |
386 | dev->priv_flags & IFF_XMIT_DST_RELEASE ? NULL : skb); | ||
387 | } | 390 | } |
388 | 391 | ||
389 | static int arp_ignore(struct in_device *in_dev, __be32 sip, __be32 tip) | 392 | static int arp_ignore(struct in_device *in_dev, __be32 sip, __be32 tip) |
@@ -654,6 +657,7 @@ static int arp_process(struct net *net, struct sock *sk, struct sk_buff *skb) | |||
654 | u16 dev_type = dev->type; | 657 | u16 dev_type = dev->type; |
655 | int addr_type; | 658 | int addr_type; |
656 | struct neighbour *n; | 659 | struct neighbour *n; |
660 | struct dst_entry *reply_dst = NULL; | ||
657 | bool is_garp = false; | 661 | bool is_garp = false; |
658 | 662 | ||
659 | /* arp_rcv below verifies the ARP header and verifies the device | 663 | /* arp_rcv below verifies the ARP header and verifies the device |
@@ -754,13 +758,18 @@ static int arp_process(struct net *net, struct sock *sk, struct sk_buff *skb) | |||
754 | * cache. | 758 | * cache. |
755 | */ | 759 | */ |
756 | 760 | ||
761 | if (arp->ar_op == htons(ARPOP_REQUEST) && skb_metadata_dst(skb)) | ||
762 | reply_dst = (struct dst_entry *) | ||
763 | iptunnel_metadata_reply(skb_metadata_dst(skb), | ||
764 | GFP_ATOMIC); | ||
765 | |||
757 | /* Special case: IPv4 duplicate address detection packet (RFC2131) */ | 766 | /* Special case: IPv4 duplicate address detection packet (RFC2131) */ |
758 | if (sip == 0) { | 767 | if (sip == 0) { |
759 | if (arp->ar_op == htons(ARPOP_REQUEST) && | 768 | if (arp->ar_op == htons(ARPOP_REQUEST) && |
760 | inet_addr_type_dev_table(net, dev, tip) == RTN_LOCAL && | 769 | inet_addr_type_dev_table(net, dev, tip) == RTN_LOCAL && |
761 | !arp_ignore(in_dev, sip, tip)) | 770 | !arp_ignore(in_dev, sip, tip)) |
762 | arp_send(ARPOP_REPLY, ETH_P_ARP, sip, dev, tip, sha, | 771 | arp_send_dst(ARPOP_REPLY, ETH_P_ARP, sip, dev, tip, |
763 | dev->dev_addr, sha); | 772 | sha, dev->dev_addr, sha, reply_dst); |
764 | goto out; | 773 | goto out; |
765 | } | 774 | } |
766 | 775 | ||
@@ -779,9 +788,10 @@ static int arp_process(struct net *net, struct sock *sk, struct sk_buff *skb) | |||
779 | if (!dont_send) { | 788 | if (!dont_send) { |
780 | n = neigh_event_ns(&arp_tbl, sha, &sip, dev); | 789 | n = neigh_event_ns(&arp_tbl, sha, &sip, dev); |
781 | if (n) { | 790 | if (n) { |
782 | arp_send(ARPOP_REPLY, ETH_P_ARP, sip, | 791 | arp_send_dst(ARPOP_REPLY, ETH_P_ARP, |
783 | dev, tip, sha, dev->dev_addr, | 792 | sip, dev, tip, sha, |
784 | sha); | 793 | dev->dev_addr, sha, |
794 | reply_dst); | ||
785 | neigh_release(n); | 795 | neigh_release(n); |
786 | } | 796 | } |
787 | } | 797 | } |
@@ -799,9 +809,10 @@ static int arp_process(struct net *net, struct sock *sk, struct sk_buff *skb) | |||
799 | if (NEIGH_CB(skb)->flags & LOCALLY_ENQUEUED || | 809 | if (NEIGH_CB(skb)->flags & LOCALLY_ENQUEUED || |
800 | skb->pkt_type == PACKET_HOST || | 810 | skb->pkt_type == PACKET_HOST || |
801 | NEIGH_VAR(in_dev->arp_parms, PROXY_DELAY) == 0) { | 811 | NEIGH_VAR(in_dev->arp_parms, PROXY_DELAY) == 0) { |
802 | arp_send(ARPOP_REPLY, ETH_P_ARP, sip, | 812 | arp_send_dst(ARPOP_REPLY, ETH_P_ARP, |
803 | dev, tip, sha, dev->dev_addr, | 813 | sip, dev, tip, sha, |
804 | sha); | 814 | dev->dev_addr, sha, |
815 | reply_dst); | ||
805 | } else { | 816 | } else { |
806 | pneigh_enqueue(&arp_tbl, | 817 | pneigh_enqueue(&arp_tbl, |
807 | in_dev->arp_parms, skb); | 818 | in_dev->arp_parms, skb); |