Subject: BOOTP support (change request)
To: None <tech-net@NetBSD.ORG>
From: Gordon W. Ross <gwr@mc.com>
List: tech-net
Date: 05/21/1997 12:49:49
It has been observed that there are difficulties with adding BOOTP
support to the nfs_mountroot code (nfs_boot.c) because the network
stack does not allow an interface to receive a unicast (UDP) until
the interface has an address assigned.  (Broadcasts are recieved,
but that does not the preferred client-server interface.)

Therefore, the following change is proposed for ip_input.c as an
alternative to the one shown in PR kern/2351.  This change adds
the following semantics to an interface with IP address zero:

  An interface that is assigned IP address 0.0.0.0 receives all
  packets that the underlying h/w interface receives, i.e. those
  with the matching h/w address or the h/w broadcast address.

Can anyone see a problem with the above proposal?
Attached is a proposed change to implement this.
Comments?

*** ip_input.c.orig	Thu Apr 24 18:33:58 1997
--- ip_input.c	Wed May 21 12:37:37 1997
***************
*** 293,298 ****
--- 293,305 ----
  			    ip->ip_dst.s_addr == ia->ia_net)
  				goto ours;
  		}
+ 		/*
+ 		 * An interface with address zero receives all
+ 		 * packets that arrive on that interface.
+ 		 */
+ 		if ((ia->ia_ifp == m->m_pkthdr.rcvif) &&
+ 		    in_nullhost(ia->ia_addr.sin_addr))
+ 			goto ours;
  	}
  	if (IN_MULTICAST(ip->ip_dst.s_addr)) {
  		struct in_multi *inm;