Searched refs:arp_hdr (Results 1 – 1 of 1) sorted by relevance
134 struct arphdr *arp_hdr = (struct arphdr *)toybuf; in recv_from() local135 unsigned char *p = (unsigned char *)(arp_hdr + 1); in recv_from()137 if (arp_hdr->ar_op != htons(ARPOP_REQUEST) && in recv_from()138 arp_hdr->ar_op != htons(ARPOP_REPLY)) return; in recv_from()143 if (arp_hdr->ar_pro != htons(ETH_P_IP) || (arp_hdr->ar_pln != 4) in recv_from()144 || (arp_hdr->ar_hln != src_pk.sll_halen) in recv_from()145 || (*recv_len < (int)(sizeof(*arp_hdr) + 2 * (4 + arp_hdr->ar_hln)))) in recv_from()148 memcpy(&s_ip.s_addr, p + arp_hdr->ar_hln, 4); in recv_from()149 memcpy(&d_ip.s_addr, p + arp_hdr->ar_hln + 4 + arp_hdr->ar_hln, 4); in recv_from()160 arp_hdr->ar_op == htons(ARPOP_REPLY) ? "ply" : "quest", in recv_from()[all …]