Subject: Re: dhcpd(8) _cannot_ be completely disabled on an interface
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Andrew Brown <>
List: tech-net
Date: 01/11/2002 18:26:01
>>> I think it would be easy to make IP_RECVIF - or something similar,
>>> cloned from it, IP_RECVIFNAME maybe - give you the interface name
>>> instead of the number.  Of course, it will be variable-size; this
>>> may complicate your userland code somewhat.  Want me to try?
>> what about having it simply fill in (and return) a struct
>> sockaddr_storage?
>Fill it in with what?  The interface name?  I'd rather use a fixed-size
>(relatively large, like 16 or 32) array of char, if you want the name
>in something fixed-size.

like perhaps the stuff that goes into a sockaddr_dl?  after all, the
IP_RECVIF option causes some of the data from the sockaddr_dl to be
passed back to userspace.  look in netinet/ip_input.c for INP_RECVIF.
why not all of it?

>If you're thinking fill it in with the interface's address, I have two
>questions: (1) which of the interface's addresses?, (2) what if
>multiple interfaces have that address?

i was thinking of the link layer address.  there's currently no way to
get that from the network layer in the kernel on a per-packet basis,
unlike, say, the receiving ip address.

>>> Oh, certainly.  Just remarking that I have had a great deal of
>>> trouble codifying that the line between "that's a bug" and "so don't
>>> do that".
>> if you expect something of the kernel, and it doesn't live up to it
>> (and no, dd'ing /dev/zero into /dev/mem is *not* something you can
>> expect the kernel to live up to),
>But why not?  The difficulty I've had lies in trying to be precise
>about exactly why it's not reasonable to expect the kernel to survive
>dd if=/dev/zero of=/dev/mem but it is reasonable to expect it to
>survive, say, experiments with routing sockets.

i guess i just can't conceive of a use for writing /dev/zero over
/dev/mem, whereas toying with routing sockets to see how they work and
how to use them makes sense...

|-----< "CODE WARRIOR" >-----|             * "ah!  i see you have the internet (Andrew Brown)                that goes *ping*!"       * "information is power -- share the wealth."