printf("is request\n")
printf("is request\n");
arprecv(d, pkt, len, tleft)	register struct iodesc *d;	register void *pkt;	register size_t len;	time_t tleft;{	register ssize_t n;	register struct ether_arp *ah;	u_int16_t etype;	/* host order */#ifdef ARP_DEBUG 	if (debug)		printf("arprecv: ");#endif	n = readether(d, pkt, len, tleft, &etype);	errno = 0;	/* XXX */	if (n == -1 || n < sizeof(struct ether_arp)) {#ifdef ARP_DEBUG		if (debug)			printf("bad len=%d\n", n);#endif		return (-1);	}	if (etype != ETHERTYPE_ARP) {#ifdef ARP_DEBUG		if (debug)			printf("not arp type=%d\n", etype);#endif		return (-1);	}	/* Ethernet address now checked in readether() */	ah = (struct ether_arp *)pkt;	if (ah->arp_hrd != htons(ARPHRD_ETHER) ||	    ah->arp_pro != htons(ETHERTYPE_IP) ||	    ah->arp_hln != sizeof(ah->arp_sha) ||	    ah->arp_pln != sizeof(ah->arp_spa) )	{#ifdef ARP_DEBUG		if (debug)			printf("bad hrd/pro/hln/pln\n")#endif		return (-1);	}	if (ah->arp_op == htons(ARPOP_REQUEST)) {#ifdef ARP_DEBUG		if (debug)			printf("is request\n")#endif		arp_reply(d, ah);		return (-1);	}	if (ah->arp_op != htons(ARPOP_REPLY)) {#ifdef ARP_DEBUG		if (debug)			printf("not ARP reply\n");#endif		return (-1);	}	/* Is the reply from the source we want? */	if (bcmp(&arp_list[arp_num].addr,			 ah->arp_spa, sizeof(ah->arp_spa)))	{#ifdef ARP_DEBUG		if (debug)			printf("unwanted address\n");#endif		return (-1);	}	/* We don't care who the reply was sent to. */	/* We have our answer. */#ifdef ARP_DEBUG 	if (debug)		printf("got it\n");#endif	return (n);}