Subject: Re: dhcpd(8) _cannot_ be completely disabled on an interface
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Andrew Brown <atatat@atatdot.net>
List: tech-net
Date: 01/08/2002 01:37:31
>>> IP_RECVIF gets you the if_index value for the interface in question.
>>> Mapping that to anything useful is up to the packet recipient.
>> egad.  i thought it was more useful than that.  i wonder what sort of
>> issues would be be incurred by *making* it more useful...
>
>What would you consider "useful"?  The if_index values are the only
>unambiguous fixed-size names interfaces have, as far as I know.

if i receive a datagram on a socket, i (naively?) expect that the
interface will still be there by the time i construct a reply that i
wish to send out said interface, in which case the interface "name"
and "address" (which have the same lifetime issues as the number) are
much more useful since i don't have to do dig in the kernel for them.
dig here equates to something like SIOCGIFCONF.

>> i tried adding an arp entry via a routing socket once.  i wasn't sure
>> of the exact formatting and construction of the routing messages,
>
>They _are_ poorly documented.  IIRC there's at least one define that
>you need but which isn't provided by any .h file; hazy memory says it's
>something about padding.

not very well documented *or* implemented.  imho, me getting it wrong
as part of my learning process should not incur punishment in the form
of the kernel panicking.  hmm...i guess i oughta fix that a little.  :)

>> what i did expect, however, was that the kernel would not let you add
>> an arp entry for an ip address which was not "local" to one of the
>> interfaces.  this is not so?
>
>Well, if I change identifying details, it looks like this:
>...
>According to the netmasks, this was off-subnet for that interface, but
>did what in these circumstances was the Right Thing (send packets out
>if2 with the MAC address from the arp entry in the Ethernet destination
>field).

neat.  i'm glad it "works".  :)

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
andrew@crossbar.com       * "information is power -- share the wealth."