Subject: Re: arping for 127.0.0.1
To: None <tech-net@NetBSD.ORG>
From: Michael C. Richardson <mcr@sandelman.ottawa.on.ca>
List: tech-net
Date: 06/15/1998 14:41:20
  I think I missed the beginning of the thread, or didn't read carefully
enough. 
  In /*	$NetBSD: if_arp.c,v 1.41.2.1 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))
				break;
		}


  How can this match 127.0.0.1 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: http://www.ssh.fi/. Secure, strong, international
 Personal: mcr@sandelman.ottawa.on.ca. PGP key available.
 Corporate: sales@sandelman.ottawa.on.ca.