Subject: Re: arping for
To: None <tech-net@NetBSD.ORG>
From: Michael C. Richardson <>
List: tech-net
Date: 06/15/1998 14:41:20
  I think I missed the beginning of the thread, or didn't read carefully
  In /*	$NetBSD: if_arp.c,v 1997/10/31 07:47:44 mellon Exp $	*/

	/* Search for a matching interface address. */
	for (ia = in_ifaddr.tqh_first; ia != 0; ia = ia->ia_list.tqe_next)
		if (ia->ia_ifp == ifp) {
			maybe_ia = ia;
			if (in_hosteq(itaddr, ia->ia_addr.sin_addr) ||
			    in_hosteq(isaddr, ia->ia_addr.sin_addr))

  How can this match unless the interface on which it arrived
was the lo device? (The test ia->ia_ifp == ifp should fail otherwise).
  I don't like this code, btw: it is linear in the number of IP addresses
configured, which dies badly on web host farms and machines with lots and
lots of dialup PPP lines.  I know that we use it a lot.
  Can't we at least use ifp->if_addrlist?

   :!mcr!:            |  Sandelman Software Works Corporation, Ottawa, ON  
   Michael Richardson |	SSH IPsec: Secure, strong, international
 Personal: PGP key available.