Re: dhclient implementation

2011-08-27 Thread Jona Joachim
On 2011-08-27, I??igo Ortiz de Urbina  wrote:
> On Sat, Aug 27, 2011 at 1:01 AM, Jona Joachim  wrote:
>> On 2011-08-26, I??igo Ortiz de Urbina  wrote:
>>> "Supersede" gives me what I want. It just felt weird those entries
>>> ended up on resolv.conf when I had not requested them.
>>>
>>> Thanks and sorry for the noise.
>>
>> This is expected behaviour for the "prepend" option, it does just that:
>> request the name servers and prepend the one(s) you supplied. That way
>> by default the system will use the name server you supplied in the
>> configuration file but will fall back to the ones given by your router
>> in case the first name server is not reachable.
>
> As I said Jona offlist, yes, I understand that behavior.

I did not say anything off list.



Re: dhclient implementation

2011-08-27 Thread Iñigo Ortiz de Urbina
On Sat, Aug 27, 2011 at 1:01 AM, Jona Joachim  wrote:
> On 2011-08-26, I??igo Ortiz de Urbina  wrote:
>> "Supersede" gives me what I want. It just felt weird those entries
>> ended up on resolv.conf when I had not requested them.
>>
>> Thanks and sorry for the noise.
>
> This is expected behaviour for the "prepend" option, it does just that:
> request the name servers and prepend the one(s) you supplied. That way
> by default the system will use the name server you supplied in the
> configuration file but will fall back to the ones given by your router
> in case the first name server is not reachable.

As I said Jona offlist, yes, I understand that behavior. My line is
prepended and then anything
else goes after it.

Still, what I do not understand is why two nameserver entries appear
on my resolv.conf, if I have never requested them.

> Best regards,
> Jona
>
>



--
IC1igo Ortiz de Urbina Cazenave
http://www.twitter.com/ioc32



Re: dhclient implementation

2011-08-26 Thread Jona Joachim
On 2011-08-26, I??igo Ortiz de Urbina  wrote:
> "Supersede" gives me what I want. It just felt weird those entries
> ended up on resolv.conf when I had not requested them.
>
> Thanks and sorry for the noise.

This is expected behaviour for the "prepend" option, it does just that:
request the name servers and prepend the one(s) you supplied. That way
by default the system will use the name server you supplied in the
configuration file but will fall back to the ones given by your router
in case the first name server is not reachable.

Best regards,
Jona



Re: dhclient implementation

2011-08-26 Thread Iñigo Ortiz de Urbina
"Supersede" gives me what I want. It just felt weird those entries
ended up on resolv.conf when I had not requested them.

Thanks and sorry for the noise.

2011/8/27 IC1igo Ortiz de Urbina :
> Hi all users and developers
>
> I simply noticed what I would call a weird behaviour on my 32 bit 4.9
> GENERIC#671 box's dhclient, which I hope is not the expected behavior.
> While reading RFC2131, I didnt find any sentence stating or implying
> that is the desired behavior, as in a "server MUST...".
>
> Say I run a local instance of named on my machine. I dont want dhcp to
> overwrite my resolv.conf, so I add the classical prepend
> dns-name-servers to my dhclient.conf.
>
> I capture the traffic while asking for an IP address (no prior leases)
> and I can see how DHCP packets do not request DNS servers. However,
> which I am afraid happens more often than not, my crappy Comtrend
> domestic router ignores the request and simply decides to always
> answer including my ISPs DNS servers. I could check this with
> Wireshark also. The result is resolv.conf has 3 nameserver entries,
> instead of the only one I want to prepend.
>
> I also tried not prepending my localhost named entry, just in case
> that would trigger something weird in the code and eventually
> nameservers got appended. No luck.
>
> dhclient.conf(5) states the following:
>
> "The protocol also allows the client to reject offers
> B  B  from servers if they don't contain information the client needs, or
if
> B  B  the information provided is not satisfactory."
>
> So, shouldnt dhclients just keep track of what they requested and just
> accept that specific set of properties, instead of all it was sent by
> the router? I am not talking about whether RFCs or the implementation
> is correct or not. I am no authority of course. It simply seems
> reasonable to me to implement it as I just mentioned. I understand
> clients can ask for parameters that would lead to an invalid network
> configurations. Still, Unix doesnt let you shoot yourself in the foot
> for a good reason? Am I missing the obvious?
>
> Any comment would be highly appreciated.
>
> Thanks for your time and have a nice day
>
>



--
IC1igo Ortiz de Urbina Cazenave
http://www.twitter.com/ioc32



Re: dhclient implementation

2011-08-26 Thread Jona Joachim
On 2011-08-26, I?igo Ortiz de Urbina  wrote:
> Hi all users and developers
>
> I simply noticed what I would call a weird behaviour on my 32 bit 4.9
> GENERIC#671 box's dhclient, which I hope is not the expected behavior.
> While reading RFC2131, I didnt find any sentence stating or implying
> that is the desired behavior, as in a "server MUST...".
>
> Say I run a local instance of named on my machine. I dont want dhcp to
> overwrite my resolv.conf, so I add the classical prepend
> dns-name-servers to my dhclient.conf.
>
> I capture the traffic while asking for an IP address (no prior leases)
> and I can see how DHCP packets do not request DNS servers. However,
> which I am afraid happens more often than not, my crappy Comtrend
> domestic router ignores the request and simply decides to always
> answer including my ISPs DNS servers. I could check this with
> Wireshark also. The result is resolv.conf has 3 nameserver entries,
> instead of the only one I want to prepend.

Not sure I understand exactly what you mean but perhaps you want "supersede"
instead of "prepend".

Best regards,
Jona



dhclient implementation

2011-08-26 Thread Iñigo Ortiz de Urbina
Hi all users and developers

I simply noticed what I would call a weird behaviour on my 32 bit 4.9
GENERIC#671 box's dhclient, which I hope is not the expected behavior.
While reading RFC2131, I didnt find any sentence stating or implying
that is the desired behavior, as in a "server MUST...".

Say I run a local instance of named on my machine. I dont want dhcp to
overwrite my resolv.conf, so I add the classical prepend
dns-name-servers to my dhclient.conf.

I capture the traffic while asking for an IP address (no prior leases)
and I can see how DHCP packets do not request DNS servers. However,
which I am afraid happens more often than not, my crappy Comtrend
domestic router ignores the request and simply decides to always
answer including my ISPs DNS servers. I could check this with
Wireshark also. The result is resolv.conf has 3 nameserver entries,
instead of the only one I want to prepend.

I also tried not prepending my localhost named entry, just in case
that would trigger something weird in the code and eventually
nameservers got appended. No luck.

dhclient.conf(5) states the following:

"The protocol also allows the client to reject offers
 from servers if they don't contain information the client needs, or if
 the information provided is not satisfactory."

So, shouldnt dhclients just keep track of what they requested and just
accept that specific set of properties, instead of all it was sent by
the router? I am not talking about whether RFCs or the implementation
is correct or not. I am no authority of course. It simply seems
reasonable to me to implement it as I just mentioned. I understand
clients can ask for parameters that would lead to an invalid network
configurations. Still, Unix doesnt let you shoot yourself in the foot
for a good reason? Am I missing the obvious?

Any comment would be highly appreciated.

Thanks for your time and have a nice day