diff options
Diffstat (limited to 'net/ipv4/arp.c')
-rw-r--r-- | net/ipv4/arp.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 36d6798947b5..08174a2aa878 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -111,12 +111,8 @@ | |||
111 | #include <net/tcp.h> | 111 | #include <net/tcp.h> |
112 | #include <net/sock.h> | 112 | #include <net/sock.h> |
113 | #include <net/arp.h> | 113 | #include <net/arp.h> |
114 | #if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) | ||
115 | #include <net/ax25.h> | 114 | #include <net/ax25.h> |
116 | #if defined(CONFIG_NETROM) || defined(CONFIG_NETROM_MODULE) | ||
117 | #include <net/netrom.h> | 115 | #include <net/netrom.h> |
118 | #endif | ||
119 | #endif | ||
120 | #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) | 116 | #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) |
121 | #include <net/atmclip.h> | 117 | #include <net/atmclip.h> |
122 | struct neigh_table *clip_tbl_hook; | 118 | struct neigh_table *clip_tbl_hook; |
@@ -710,7 +706,7 @@ static int arp_process(struct sk_buff *skb) | |||
710 | struct arphdr *arp; | 706 | struct arphdr *arp; |
711 | unsigned char *arp_ptr; | 707 | unsigned char *arp_ptr; |
712 | struct rtable *rt; | 708 | struct rtable *rt; |
713 | unsigned char *sha, *tha; | 709 | unsigned char *sha; |
714 | __be32 sip, tip; | 710 | __be32 sip, tip; |
715 | u16 dev_type = dev->type; | 711 | u16 dev_type = dev->type; |
716 | int addr_type; | 712 | int addr_type; |
@@ -731,20 +727,10 @@ static int arp_process(struct sk_buff *skb) | |||
731 | htons(dev_type) != arp->ar_hrd) | 727 | htons(dev_type) != arp->ar_hrd) |
732 | goto out; | 728 | goto out; |
733 | break; | 729 | break; |
734 | #ifdef CONFIG_NET_ETHERNET | ||
735 | case ARPHRD_ETHER: | 730 | case ARPHRD_ETHER: |
736 | #endif | ||
737 | #ifdef CONFIG_TR | ||
738 | case ARPHRD_IEEE802_TR: | 731 | case ARPHRD_IEEE802_TR: |
739 | #endif | ||
740 | #ifdef CONFIG_FDDI | ||
741 | case ARPHRD_FDDI: | 732 | case ARPHRD_FDDI: |
742 | #endif | ||
743 | #ifdef CONFIG_NET_FC | ||
744 | case ARPHRD_IEEE802: | 733 | case ARPHRD_IEEE802: |
745 | #endif | ||
746 | #if defined(CONFIG_NET_ETHERNET) || defined(CONFIG_TR) || \ | ||
747 | defined(CONFIG_FDDI) || defined(CONFIG_NET_FC) | ||
748 | /* | 734 | /* |
749 | * ETHERNET, Token Ring and Fibre Channel (which are IEEE 802 | 735 | * ETHERNET, Token Ring and Fibre Channel (which are IEEE 802 |
750 | * devices, according to RFC 2625) devices will accept ARP | 736 | * devices, according to RFC 2625) devices will accept ARP |
@@ -759,21 +745,16 @@ static int arp_process(struct sk_buff *skb) | |||
759 | arp->ar_pro != htons(ETH_P_IP)) | 745 | arp->ar_pro != htons(ETH_P_IP)) |
760 | goto out; | 746 | goto out; |
761 | break; | 747 | break; |
762 | #endif | ||
763 | #if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) | ||
764 | case ARPHRD_AX25: | 748 | case ARPHRD_AX25: |
765 | if (arp->ar_pro != htons(AX25_P_IP) || | 749 | if (arp->ar_pro != htons(AX25_P_IP) || |
766 | arp->ar_hrd != htons(ARPHRD_AX25)) | 750 | arp->ar_hrd != htons(ARPHRD_AX25)) |
767 | goto out; | 751 | goto out; |
768 | break; | 752 | break; |
769 | #if defined(CONFIG_NETROM) || defined(CONFIG_NETROM_MODULE) | ||
770 | case ARPHRD_NETROM: | 753 | case ARPHRD_NETROM: |
771 | if (arp->ar_pro != htons(AX25_P_IP) || | 754 | if (arp->ar_pro != htons(AX25_P_IP) || |
772 | arp->ar_hrd != htons(ARPHRD_NETROM)) | 755 | arp->ar_hrd != htons(ARPHRD_NETROM)) |
773 | goto out; | 756 | goto out; |
774 | break; | 757 | break; |
775 | #endif | ||
776 | #endif | ||
777 | } | 758 | } |
778 | 759 | ||
779 | /* Understand only these message types */ | 760 | /* Understand only these message types */ |
@@ -790,7 +771,6 @@ static int arp_process(struct sk_buff *skb) | |||
790 | arp_ptr += dev->addr_len; | 771 | arp_ptr += dev->addr_len; |
791 | memcpy(&sip, arp_ptr, 4); | 772 | memcpy(&sip, arp_ptr, 4); |
792 | arp_ptr += 4; | 773 | arp_ptr += 4; |
793 | tha = arp_ptr; | ||
794 | arp_ptr += dev->addr_len; | 774 | arp_ptr += dev->addr_len; |
795 | memcpy(&tip, arp_ptr, 4); | 775 | memcpy(&tip, arp_ptr, 4); |
796 | /* | 776 | /* |
@@ -828,7 +808,8 @@ static int arp_process(struct sk_buff *skb) | |||
828 | if (arp->ar_op == htons(ARPOP_REQUEST) && | 808 | if (arp->ar_op == htons(ARPOP_REQUEST) && |
829 | inet_addr_type(tip) == RTN_LOCAL && | 809 | inet_addr_type(tip) == RTN_LOCAL && |
830 | !arp_ignore(in_dev,dev,sip,tip)) | 810 | !arp_ignore(in_dev,dev,sip,tip)) |
831 | arp_send(ARPOP_REPLY,ETH_P_ARP,tip,dev,tip,sha,dev->dev_addr,dev->dev_addr); | 811 | arp_send(ARPOP_REPLY, ETH_P_ARP, sip, dev, tip, sha, |
812 | dev->dev_addr, sha); | ||
832 | goto out; | 813 | goto out; |
833 | } | 814 | } |
834 | 815 | ||