aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/networking/ip-sysctl.txt2
-rw-r--r--include/linux/etherdevice.h16
-rw-r--r--net/ethernet/eth.c17
-rw-r--r--net/ipv4/fib_frontend.c2
4 files changed, 20 insertions, 17 deletions
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index b433c8a27e2d..65895bb51414 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -309,7 +309,7 @@ tcp_tso_win_divisor - INTEGER
309 can be consumed by a single TSO frame. 309 can be consumed by a single TSO frame.
310 The setting of this parameter is a choice between burstiness and 310 The setting of this parameter is a choice between burstiness and
311 building larger TSO frames. 311 building larger TSO frames.
312 Default: 8 312 Default: 3
313 313
314tcp_frto - BOOLEAN 314tcp_frto - BOOLEAN
315 Enables F-RTO, an enhanced recovery algorithm for TCP retransmission 315 Enables F-RTO, an enhanced recovery algorithm for TCP retransmission
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 4522c7186bf3..cc84934f9059 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -104,6 +104,22 @@ static inline void random_ether_addr(u8 *addr)
104 addr [0] &= 0xfe; /* clear multicast bit */ 104 addr [0] &= 0xfe; /* clear multicast bit */
105 addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ 105 addr [0] |= 0x02; /* set local assignment bit (IEEE802) */
106} 106}
107
108/**
109 * compare_ether_addr - Compare two Ethernet addresses
110 * @addr1: Pointer to a six-byte array containing the Ethernet address
111 * @addr2 Pointer other six-byte array containing the Ethernet address
112 *
113 * Compare two ethernet addresses, returns 0 if equal
114 */
115static inline unsigned compare_ether_addr(const u8 *_a, const u8 *_b)
116{
117 const u16 *a = (const u16 *) _a;
118 const u16 *b = (const u16 *) _b;
119
120 BUILD_BUG_ON(ETH_ALEN != 6);
121 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0;
122}
107#endif /* __KERNEL__ */ 123#endif /* __KERNEL__ */
108 124
109#endif /* _LINUX_ETHERDEVICE_H */ 125#endif /* _LINUX_ETHERDEVICE_H */
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index 68a5ca866442..e24577367274 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -146,19 +146,6 @@ int eth_rebuild_header(struct sk_buff *skb)
146 return 0; 146 return 0;
147} 147}
148 148
149static inline unsigned int compare_eth_addr(const unsigned char *__a, const unsigned char *__b)
150{
151 const unsigned short *dest = (unsigned short *) __a;
152 const unsigned short *devaddr = (unsigned short *) __b;
153 unsigned int res;
154
155 BUILD_BUG_ON(ETH_ALEN != 6);
156 res = ((dest[0] ^ devaddr[0]) |
157 (dest[1] ^ devaddr[1]) |
158 (dest[2] ^ devaddr[2])) != 0;
159
160 return res;
161}
162 149
163/* 150/*
164 * Determine the packet's protocol ID. The rule here is that we 151 * Determine the packet's protocol ID. The rule here is that we
@@ -176,7 +163,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
176 eth = eth_hdr(skb); 163 eth = eth_hdr(skb);
177 164
178 if (*eth->h_dest&1) { 165 if (*eth->h_dest&1) {
179 if (!compare_eth_addr(eth->h_dest, dev->broadcast)) 166 if (!compare_ether_addr(eth->h_dest, dev->broadcast))
180 skb->pkt_type = PACKET_BROADCAST; 167 skb->pkt_type = PACKET_BROADCAST;
181 else 168 else
182 skb->pkt_type = PACKET_MULTICAST; 169 skb->pkt_type = PACKET_MULTICAST;
@@ -191,7 +178,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
191 */ 178 */
192 179
193 else if(1 /*dev->flags&IFF_PROMISC*/) { 180 else if(1 /*dev->flags&IFF_PROMISC*/) {
194 if (unlikely(compare_eth_addr(eth->h_dest, dev->dev_addr))) 181 if (unlikely(compare_ether_addr(eth->h_dest, dev->dev_addr)))
195 skb->pkt_type = PACKET_OTHERHOST; 182 skb->pkt_type = PACKET_OTHERHOST;
196 } 183 }
197 184
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index e61bc7177eb1..990633c09dfe 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -591,7 +591,7 @@ static int fib_inetaddr_event(struct notifier_block *this, unsigned long event,
591 break; 591 break;
592 case NETDEV_DOWN: 592 case NETDEV_DOWN:
593 fib_del_ifaddr(ifa); 593 fib_del_ifaddr(ifa);
594 if (ifa->ifa_dev && ifa->ifa_dev->ifa_list == NULL) { 594 if (ifa->ifa_dev->ifa_list == NULL) {
595 /* Last address was deleted from this interface. 595 /* Last address was deleted from this interface.
596 Disable IP. 596 Disable IP.
597 */ 597 */