Lines Matching defs:arp

20 #include <net/arp.h>
56 static void rlb_purge_src_ip(struct bonding *bond, struct arp_pkt *arp);
248 static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp)
256 hash_index = _simple_hash((u8 *)&(arp->ip_src), sizeof(arp->ip_src));
260 (client_info->ip_src == arp->ip_dst) &&
261 (client_info->ip_dst == arp->ip_src) &&
262 (!ether_addr_equal_64bits(client_info->mac_dst, arp->mac_src))) {
264 ether_addr_copy(client_info->mac_dst, arp->mac_src);
275 struct arp_pkt *arp, _arp;
280 arp = skb_header_pointer(skb, 0, sizeof(_arp), &_arp);
281 if (!arp)
284 /* We received an ARP from arp->ip_src.
287 * However, if arp->mac_src is different than what is stored in
294 rlb_purge_src_ip(bond, arp);
296 if (arp->op_code == htons(ARPOP_REPLY)) {
298 rlb_update_entry_from_arp(bond, arp);
555 const struct arp_pkt *arp)
566 hash_index = _simple_hash((u8 *)&arp->ip_dst, sizeof(arp->ip_dst));
570 if ((client_info->ip_src == arp->ip_src) &&
571 (client_info->ip_dst == arp->ip_dst)) {
573 if (!is_broadcast_ether_addr(arp->mac_dst)) {
574 /* update mac address from arp */
575 ether_addr_copy(client_info->mac_dst, arp->mac_dst);
577 ether_addr_copy(client_info->mac_src, arp->mac_src);
601 client_info->ip_src == arp->ip_src)) {
605 u32 hash_src = _simple_hash((u8 *)&arp->ip_src,
606 sizeof(arp->ip_src));
611 client_info->ip_src = arp->ip_src;
612 client_info->ip_dst = arp->ip_dst;
613 /* arp->mac_dst is broadcast for arp requests.
615 * upon receiving an arp reply.
617 ether_addr_copy(client_info->mac_dst, arp->mac_dst);
618 ether_addr_copy(client_info->mac_src, arp->mac_src);
649 /* chooses (and returns) transmit channel for arp reply
650 * does not choose channel for other arp types since they are
657 struct arp_pkt *arp;
659 if (!pskb_network_may_pull(skb, sizeof(*arp)))
661 arp = (struct arp_pkt *)skb_network_header(skb);
666 if (!bond_slave_has_mac_rcu(bond, arp->mac_src))
669 dev = ip_dev_find(dev_net(bond->dev), arp->ip_src);
678 if (arp->op_code == htons(ARPOP_REPLY)) {
679 /* the arp must be sent on the selected rx channel */
680 tx_slave = rlb_choose_channel(skb, bond, arp);
682 bond_hw_addr_copy(arp->mac_src, tx_slave->dev->dev_addr,
686 } else if (arp->op_code == htons(ARPOP_REQUEST)) {
689 * When the arp reply is received the entry will be updated
692 tx_slave = rlb_choose_channel(skb, bond, arp);
699 /* arp requests are broadcast and are sent on the primary
700 * the arp request will collapse all clients on the subnet to
704 rlb_req_update_subnet_clients(bond, arp->ip_src);
831 /* deletes all rx_hashtbl entries with arp->ip_src if their mac_src does
832 * not match arp->mac_src
834 static void rlb_purge_src_ip(struct bonding *bond, struct arp_pkt *arp)
837 u32 ip_src_hash = _simple_hash((u8 *)&(arp->ip_src), sizeof(arp->ip_src));
847 if (entry->ip_src == arp->ip_src &&
848 !ether_addr_equal_64bits(arp->mac_src, entry->mac_src))
1695 * not work because the rebalance arp replies will