Subject: Re: net/if.c fix for netatalk
To: Christian E. Hopps <chopps@merit.edu>
From: Bill Studenmund <wrstuden@nas.nasa.gov>
List: tech-net
Date: 07/01/1999 17:28:00
On 1 Jul 1999, Christian E. Hopps wrote:

> Manuel Bouyer <bouyer@antioche.lip6.fr> writes:
> > Netatalk uses net ranges instead, where a physical network is designed by
> > a pair of low net/higth net (this is also why netatalk may use several
> > routing table entries for a physical link, to convert this low net/higth net
> > into a successtion of addr/netmask).
> [...]
> > So I fixed ifa_ifwithnet(), and for that I needed to add netatalk-specific
> > code (In fact if we are looking for a netatalk interface just use
> > at_ifawithnet() which does the rigth thing).
> > 
> > Diffs are attached. Does anyone object to this change ?
> > The only problem I can see is that if.c has now protocol-dependant sections,
> > but I don't see how to fix it better.
> 
> Well instead of adding N routes when the interface net ranges is
> configured why not add N ifaddrs?  These would then turn into your
> routes and the if_withnet would work.  While this may seem gross its at
> least consistent, and perhaps less gross than adding netatalk specific
> things into the generic code. 

But you only have one address. My netatalk machine's down, so I can't
demonstrate, but typically it'd be something like

502.32   in a range from 500->510

If I did the math right, we'd have routes 500->503 (0x1f4->0x1f7),
504->507 (0x1f8->0x1fb), 508->509 (0x1fc->0x1fd), and 510.

If I understood you right (which I might not have) you're sugegsting
adding extra addresses in that range. That's wrong in that other machines
on the wire might have those addresses. :-)

> The other suggestion I have would be to add a protocol or ifnet specific
> match function which if_withnet could use to locate the ifaddr.

I think some sort of family-specific call would be best.

> (P.S. I have never looked at the netatalk code so please forgive me if
> the first suggestion is a dumb :)

That's ok. Apple did things differently than Berkeley did. :-)

Take care,

Bill