diff options
-rw-r--r-- | drivers/net/bonding/bond_alb.c | 58 | ||||
-rw-r--r-- | drivers/net/macvlan.c | 7 | ||||
-rw-r--r-- | net/ethernet/eth.c | 5 |
3 files changed, 35 insertions, 35 deletions
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 9abfde479316..b4f1b4ac92c6 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -332,7 +332,7 @@ static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp) | |||
332 | if ((client_info->assigned) && | 332 | if ((client_info->assigned) && |
333 | (client_info->ip_src == arp->ip_dst) && | 333 | (client_info->ip_src == arp->ip_dst) && |
334 | (client_info->ip_dst == arp->ip_src) && | 334 | (client_info->ip_dst == arp->ip_src) && |
335 | (compare_ether_addr_64bits(client_info->mac_dst, arp->mac_src))) { | 335 | (!ether_addr_equal_64bits(client_info->mac_dst, arp->mac_src))) { |
336 | /* update the clients MAC address */ | 336 | /* update the clients MAC address */ |
337 | memcpy(client_info->mac_dst, arp->mac_src, ETH_ALEN); | 337 | memcpy(client_info->mac_dst, arp->mac_src, ETH_ALEN); |
338 | client_info->ntt = 1; | 338 | client_info->ntt = 1; |
@@ -448,8 +448,8 @@ static void rlb_clear_slave(struct bonding *bond, struct slave *slave) | |||
448 | 448 | ||
449 | if (assigned_slave) { | 449 | if (assigned_slave) { |
450 | rx_hash_table[index].slave = assigned_slave; | 450 | rx_hash_table[index].slave = assigned_slave; |
451 | if (compare_ether_addr_64bits(rx_hash_table[index].mac_dst, | 451 | if (!ether_addr_equal_64bits(rx_hash_table[index].mac_dst, |
452 | mac_bcast)) { | 452 | mac_bcast)) { |
453 | bond_info->rx_hashtbl[index].ntt = 1; | 453 | bond_info->rx_hashtbl[index].ntt = 1; |
454 | bond_info->rx_ntt = 1; | 454 | bond_info->rx_ntt = 1; |
455 | /* A slave has been removed from the | 455 | /* A slave has been removed from the |
@@ -561,7 +561,7 @@ static void rlb_req_update_slave_clients(struct bonding *bond, struct slave *sla | |||
561 | client_info = &(bond_info->rx_hashtbl[hash_index]); | 561 | client_info = &(bond_info->rx_hashtbl[hash_index]); |
562 | 562 | ||
563 | if ((client_info->slave == slave) && | 563 | if ((client_info->slave == slave) && |
564 | compare_ether_addr_64bits(client_info->mac_dst, mac_bcast)) { | 564 | !ether_addr_equal_64bits(client_info->mac_dst, mac_bcast)) { |
565 | client_info->ntt = 1; | 565 | client_info->ntt = 1; |
566 | ntt = 1; | 566 | ntt = 1; |
567 | } | 567 | } |
@@ -600,9 +600,9 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, __be32 src_ip) | |||
600 | * unicast mac address. | 600 | * unicast mac address. |
601 | */ | 601 | */ |
602 | if ((client_info->ip_src == src_ip) && | 602 | if ((client_info->ip_src == src_ip) && |
603 | compare_ether_addr_64bits(client_info->slave->dev->dev_addr, | 603 | !ether_addr_equal_64bits(client_info->slave->dev->dev_addr, |
604 | bond->dev->dev_addr) && | 604 | bond->dev->dev_addr) && |
605 | compare_ether_addr_64bits(client_info->mac_dst, mac_bcast)) { | 605 | !ether_addr_equal_64bits(client_info->mac_dst, mac_bcast)) { |
606 | client_info->ntt = 1; | 606 | client_info->ntt = 1; |
607 | bond_info->rx_ntt = 1; | 607 | bond_info->rx_ntt = 1; |
608 | } | 608 | } |
@@ -629,7 +629,7 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon | |||
629 | if ((client_info->ip_src == arp->ip_src) && | 629 | if ((client_info->ip_src == arp->ip_src) && |
630 | (client_info->ip_dst == arp->ip_dst)) { | 630 | (client_info->ip_dst == arp->ip_dst)) { |
631 | /* the entry is already assigned to this client */ | 631 | /* the entry is already assigned to this client */ |
632 | if (compare_ether_addr_64bits(arp->mac_dst, mac_bcast)) { | 632 | if (!ether_addr_equal_64bits(arp->mac_dst, mac_bcast)) { |
633 | /* update mac address from arp */ | 633 | /* update mac address from arp */ |
634 | memcpy(client_info->mac_dst, arp->mac_dst, ETH_ALEN); | 634 | memcpy(client_info->mac_dst, arp->mac_dst, ETH_ALEN); |
635 | } | 635 | } |
@@ -664,7 +664,7 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon | |||
664 | memcpy(client_info->mac_dst, arp->mac_dst, ETH_ALEN); | 664 | memcpy(client_info->mac_dst, arp->mac_dst, ETH_ALEN); |
665 | client_info->slave = assigned_slave; | 665 | client_info->slave = assigned_slave; |
666 | 666 | ||
667 | if (compare_ether_addr_64bits(client_info->mac_dst, mac_bcast)) { | 667 | if (!ether_addr_equal_64bits(client_info->mac_dst, mac_bcast)) { |
668 | client_info->ntt = 1; | 668 | client_info->ntt = 1; |
669 | bond->alb_info.rx_ntt = 1; | 669 | bond->alb_info.rx_ntt = 1; |
670 | } else { | 670 | } else { |
@@ -1009,18 +1009,18 @@ static void alb_change_hw_addr_on_detach(struct bonding *bond, struct slave *sla | |||
1009 | int perm_curr_diff; | 1009 | int perm_curr_diff; |
1010 | int perm_bond_diff; | 1010 | int perm_bond_diff; |
1011 | 1011 | ||
1012 | perm_curr_diff = compare_ether_addr_64bits(slave->perm_hwaddr, | 1012 | perm_curr_diff = !ether_addr_equal_64bits(slave->perm_hwaddr, |
1013 | slave->dev->dev_addr); | 1013 | slave->dev->dev_addr); |
1014 | perm_bond_diff = compare_ether_addr_64bits(slave->perm_hwaddr, | 1014 | perm_bond_diff = !ether_addr_equal_64bits(slave->perm_hwaddr, |
1015 | bond->dev->dev_addr); | 1015 | bond->dev->dev_addr); |
1016 | 1016 | ||
1017 | if (perm_curr_diff && perm_bond_diff) { | 1017 | if (perm_curr_diff && perm_bond_diff) { |
1018 | struct slave *tmp_slave; | 1018 | struct slave *tmp_slave; |
1019 | int i, found = 0; | 1019 | int i, found = 0; |
1020 | 1020 | ||
1021 | bond_for_each_slave(bond, tmp_slave, i) { | 1021 | bond_for_each_slave(bond, tmp_slave, i) { |
1022 | if (!compare_ether_addr_64bits(slave->perm_hwaddr, | 1022 | if (ether_addr_equal_64bits(slave->perm_hwaddr, |
1023 | tmp_slave->dev->dev_addr)) { | 1023 | tmp_slave->dev->dev_addr)) { |
1024 | found = 1; | 1024 | found = 1; |
1025 | break; | 1025 | break; |
1026 | } | 1026 | } |
@@ -1074,10 +1074,10 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav | |||
1074 | * check uniqueness of slave's mac address against the other | 1074 | * check uniqueness of slave's mac address against the other |
1075 | * slaves in the bond. | 1075 | * slaves in the bond. |
1076 | */ | 1076 | */ |
1077 | if (compare_ether_addr_64bits(slave->perm_hwaddr, bond->dev->dev_addr)) { | 1077 | if (!ether_addr_equal_64bits(slave->perm_hwaddr, bond->dev->dev_addr)) { |
1078 | bond_for_each_slave(bond, tmp_slave1, i) { | 1078 | bond_for_each_slave(bond, tmp_slave1, i) { |
1079 | if (!compare_ether_addr_64bits(tmp_slave1->dev->dev_addr, | 1079 | if (ether_addr_equal_64bits(tmp_slave1->dev->dev_addr, |
1080 | slave->dev->dev_addr)) { | 1080 | slave->dev->dev_addr)) { |
1081 | found = 1; | 1081 | found = 1; |
1082 | break; | 1082 | break; |
1083 | } | 1083 | } |
@@ -1099,8 +1099,8 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav | |||
1099 | bond_for_each_slave(bond, tmp_slave1, i) { | 1099 | bond_for_each_slave(bond, tmp_slave1, i) { |
1100 | found = 0; | 1100 | found = 0; |
1101 | bond_for_each_slave(bond, tmp_slave2, j) { | 1101 | bond_for_each_slave(bond, tmp_slave2, j) { |
1102 | if (!compare_ether_addr_64bits(tmp_slave1->perm_hwaddr, | 1102 | if (ether_addr_equal_64bits(tmp_slave1->perm_hwaddr, |
1103 | tmp_slave2->dev->dev_addr)) { | 1103 | tmp_slave2->dev->dev_addr)) { |
1104 | found = 1; | 1104 | found = 1; |
1105 | break; | 1105 | break; |
1106 | } | 1106 | } |
@@ -1115,8 +1115,8 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav | |||
1115 | } | 1115 | } |
1116 | 1116 | ||
1117 | if (!has_bond_addr) { | 1117 | if (!has_bond_addr) { |
1118 | if (!compare_ether_addr_64bits(tmp_slave1->dev->dev_addr, | 1118 | if (ether_addr_equal_64bits(tmp_slave1->dev->dev_addr, |
1119 | bond->dev->dev_addr)) { | 1119 | bond->dev->dev_addr)) { |
1120 | 1120 | ||
1121 | has_bond_addr = tmp_slave1; | 1121 | has_bond_addr = tmp_slave1; |
1122 | } | 1122 | } |
@@ -1257,7 +1257,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) | |||
1257 | case ETH_P_IP: { | 1257 | case ETH_P_IP: { |
1258 | const struct iphdr *iph = ip_hdr(skb); | 1258 | const struct iphdr *iph = ip_hdr(skb); |
1259 | 1259 | ||
1260 | if (!compare_ether_addr_64bits(eth_data->h_dest, mac_bcast) || | 1260 | if (ether_addr_equal_64bits(eth_data->h_dest, mac_bcast) || |
1261 | (iph->daddr == ip_bcast) || | 1261 | (iph->daddr == ip_bcast) || |
1262 | (iph->protocol == IPPROTO_IGMP)) { | 1262 | (iph->protocol == IPPROTO_IGMP)) { |
1263 | do_tx_balance = 0; | 1263 | do_tx_balance = 0; |
@@ -1271,7 +1271,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) | |||
1271 | /* IPv6 doesn't really use broadcast mac address, but leave | 1271 | /* IPv6 doesn't really use broadcast mac address, but leave |
1272 | * that here just in case. | 1272 | * that here just in case. |
1273 | */ | 1273 | */ |
1274 | if (!compare_ether_addr_64bits(eth_data->h_dest, mac_bcast)) { | 1274 | if (ether_addr_equal_64bits(eth_data->h_dest, mac_bcast)) { |
1275 | do_tx_balance = 0; | 1275 | do_tx_balance = 0; |
1276 | break; | 1276 | break; |
1277 | } | 1277 | } |
@@ -1279,7 +1279,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) | |||
1279 | /* IPv6 uses all-nodes multicast as an equivalent to | 1279 | /* IPv6 uses all-nodes multicast as an equivalent to |
1280 | * broadcasts in IPv4. | 1280 | * broadcasts in IPv4. |
1281 | */ | 1281 | */ |
1282 | if (!compare_ether_addr_64bits(eth_data->h_dest, mac_v6_allmcast)) { | 1282 | if (ether_addr_equal_64bits(eth_data->h_dest, mac_v6_allmcast)) { |
1283 | do_tx_balance = 0; | 1283 | do_tx_balance = 0; |
1284 | break; | 1284 | break; |
1285 | } | 1285 | } |
@@ -1603,8 +1603,8 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave | |||
1603 | struct slave *tmp_slave; | 1603 | struct slave *tmp_slave; |
1604 | /* find slave that is holding the bond's mac address */ | 1604 | /* find slave that is holding the bond's mac address */ |
1605 | bond_for_each_slave(bond, tmp_slave, i) { | 1605 | bond_for_each_slave(bond, tmp_slave, i) { |
1606 | if (!compare_ether_addr_64bits(tmp_slave->dev->dev_addr, | 1606 | if (ether_addr_equal_64bits(tmp_slave->dev->dev_addr, |
1607 | bond->dev->dev_addr)) { | 1607 | bond->dev->dev_addr)) { |
1608 | swap_slave = tmp_slave; | 1608 | swap_slave = tmp_slave; |
1609 | break; | 1609 | break; |
1610 | } | 1610 | } |
@@ -1681,8 +1681,8 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr) | |||
1681 | swap_slave = NULL; | 1681 | swap_slave = NULL; |
1682 | 1682 | ||
1683 | bond_for_each_slave(bond, slave, i) { | 1683 | bond_for_each_slave(bond, slave, i) { |
1684 | if (!compare_ether_addr_64bits(slave->dev->dev_addr, | 1684 | if (ether_addr_equal_64bits(slave->dev->dev_addr, |
1685 | bond_dev->dev_addr)) { | 1685 | bond_dev->dev_addr)) { |
1686 | swap_slave = slave; | 1686 | swap_slave = slave; |
1687 | break; | 1687 | break; |
1688 | } | 1688 | } |
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 9653ed6998fe..ebacec1944ed 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -57,7 +57,7 @@ static struct macvlan_dev *macvlan_hash_lookup(const struct macvlan_port *port, | |||
57 | struct hlist_node *n; | 57 | struct hlist_node *n; |
58 | 58 | ||
59 | hlist_for_each_entry_rcu(vlan, n, &port->vlan_hash[addr[5]], hlist) { | 59 | hlist_for_each_entry_rcu(vlan, n, &port->vlan_hash[addr[5]], hlist) { |
60 | if (!compare_ether_addr_64bits(vlan->dev->dev_addr, addr)) | 60 | if (ether_addr_equal_64bits(vlan->dev->dev_addr, addr)) |
61 | return vlan; | 61 | return vlan; |
62 | } | 62 | } |
63 | return NULL; | 63 | return NULL; |
@@ -96,7 +96,7 @@ static int macvlan_addr_busy(const struct macvlan_port *port, | |||
96 | * currently in use by the underlying device or | 96 | * currently in use by the underlying device or |
97 | * another macvlan. | 97 | * another macvlan. |
98 | */ | 98 | */ |
99 | if (!compare_ether_addr_64bits(port->dev->dev_addr, addr)) | 99 | if (ether_addr_equal_64bits(port->dev->dev_addr, addr)) |
100 | return 1; | 100 | return 1; |
101 | 101 | ||
102 | if (macvlan_hash_lookup(port, addr)) | 102 | if (macvlan_hash_lookup(port, addr)) |
@@ -118,8 +118,7 @@ static int macvlan_broadcast_one(struct sk_buff *skb, | |||
118 | return vlan->forward(dev, skb); | 118 | return vlan->forward(dev, skb); |
119 | 119 | ||
120 | skb->dev = dev; | 120 | skb->dev = dev; |
121 | if (!compare_ether_addr_64bits(eth->h_dest, | 121 | if (ether_addr_equal_64bits(eth->h_dest, dev->broadcast)) |
122 | dev->broadcast)) | ||
123 | skb->pkt_type = PACKET_BROADCAST; | 122 | skb->pkt_type = PACKET_BROADCAST; |
124 | else | 123 | else |
125 | skb->pkt_type = PACKET_MULTICAST; | 124 | skb->pkt_type = PACKET_MULTICAST; |
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index 5889a6c38a10..36e58800a9e3 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c | |||
@@ -164,7 +164,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev) | |||
164 | eth = eth_hdr(skb); | 164 | eth = eth_hdr(skb); |
165 | 165 | ||
166 | if (unlikely(is_multicast_ether_addr(eth->h_dest))) { | 166 | if (unlikely(is_multicast_ether_addr(eth->h_dest))) { |
167 | if (!compare_ether_addr_64bits(eth->h_dest, dev->broadcast)) | 167 | if (ether_addr_equal_64bits(eth->h_dest, dev->broadcast)) |
168 | skb->pkt_type = PACKET_BROADCAST; | 168 | skb->pkt_type = PACKET_BROADCAST; |
169 | else | 169 | else |
170 | skb->pkt_type = PACKET_MULTICAST; | 170 | skb->pkt_type = PACKET_MULTICAST; |
@@ -179,7 +179,8 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev) | |||
179 | */ | 179 | */ |
180 | 180 | ||
181 | else if (1 /*dev->flags&IFF_PROMISC */ ) { | 181 | else if (1 /*dev->flags&IFF_PROMISC */ ) { |
182 | if (unlikely(compare_ether_addr_64bits(eth->h_dest, dev->dev_addr))) | 182 | if (unlikely(!ether_addr_equal_64bits(eth->h_dest, |
183 | dev->dev_addr))) | ||
183 | skb->pkt_type = PACKET_OTHERHOST; | 184 | skb->pkt_type = PACKET_OTHERHOST; |
184 | } | 185 | } |
185 | 186 | ||