Lines Matching refs:arp
21 #include <net/arp.h>
56 static void rlb_purge_src_ip(struct bonding *bond, struct arp_pkt *arp);
247 static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp)
255 hash_index = _simple_hash((u8 *)&(arp->ip_src), sizeof(arp->ip_src));
259 (client_info->ip_src == arp->ip_dst) &&
260 (client_info->ip_dst == arp->ip_src) &&
261 (!ether_addr_equal_64bits(client_info->mac_dst, arp->mac_src))) {
263 ether_addr_copy(client_info->mac_dst, arp->mac_src);
274 struct arp_pkt *arp, _arp;
279 arp = skb_header_pointer(skb, 0, sizeof(_arp), &_arp);
280 if (!arp)
283 /* We received an ARP from arp->ip_src.
286 * However, if arp->mac_src is different than what is stored in
293 rlb_purge_src_ip(bond, arp);
295 if (arp->op_code == htons(ARPOP_REPLY)) {
297 rlb_update_entry_from_arp(bond, arp);
553 const struct arp_pkt *arp)
564 hash_index = _simple_hash((u8 *)&arp->ip_dst, sizeof(arp->ip_dst));
568 if ((client_info->ip_src == arp->ip_src) &&
569 (client_info->ip_dst == arp->ip_dst)) {
571 if (!is_broadcast_ether_addr(arp->mac_dst)) {
572 /* update mac address from arp */
573 ether_addr_copy(client_info->mac_dst, arp->mac_dst);
575 ether_addr_copy(client_info->mac_src, arp->mac_src);
599 client_info->ip_src == arp->ip_src)) {
603 u32 hash_src = _simple_hash((u8 *)&arp->ip_src,
604 sizeof(arp->ip_src));
609 client_info->ip_src = arp->ip_src;
610 client_info->ip_dst = arp->ip_dst;
611 /* arp->mac_dst is broadcast for arp reqeusts.
613 * upon receiving an arp reply.
615 ether_addr_copy(client_info->mac_dst, arp->mac_dst);
616 ether_addr_copy(client_info->mac_src, arp->mac_src);
646 /* chooses (and returns) transmit channel for arp reply
647 * does not choose channel for other arp types since they are
653 struct arp_pkt *arp;
655 if (!pskb_network_may_pull(skb, sizeof(*arp)))
657 arp = (struct arp_pkt *)skb_network_header(skb);
662 if (!bond_slave_has_mac_rcu(bond, arp->mac_src))
665 if (arp->op_code == htons(ARPOP_REPLY)) {
666 /* the arp must be sent on the selected rx channel */
667 tx_slave = rlb_choose_channel(skb, bond, arp);
669 bond_hw_addr_copy(arp->mac_src, tx_slave->dev->dev_addr,
673 } else if (arp->op_code == htons(ARPOP_REQUEST)) {
676 * When the arp reply is received the entry will be updated
679 tx_slave = rlb_choose_channel(skb, bond, arp);
686 /* arp requests are broadcast and are sent on the primary
687 * the arp request will collapse all clients on the subnet to
691 rlb_req_update_subnet_clients(bond, arp->ip_src);
818 /* deletes all rx_hashtbl entries with arp->ip_src if their mac_src does
819 * not match arp->mac_src
821 static void rlb_purge_src_ip(struct bonding *bond, struct arp_pkt *arp)
824 u32 ip_src_hash = _simple_hash((u8 *)&(arp->ip_src), sizeof(arp->ip_src));
833 if (entry->ip_src == arp->ip_src &&
834 !ether_addr_equal_64bits(arp->mac_src, entry->mac_src))
1688 * not work because the rebalance arp replies will