netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: PROBLEM: Interface address change netlink socket problem.(Patch
@ 2002-10-10  2:46 jamal
  2002-10-10  4:23 ` Vividh Siddha
  0 siblings, 1 reply; 3+ messages in thread
From: jamal @ 2002-10-10  2:46 UTC (permalink / raw)
  To: Vividh Siddha; +Cc: netdev, David S. Miller


Moved to netdev where it belongs. Vividh in the future please post
to netdev or at least cross-post to it ... because the kernel list
FAQ says so.

In your posting you say:
> Imagine a interface eth0 with address 10.10.10.10, netmask 0xffffff00
> and broadcast 10.10.10.255.
>
>For eg: if the following command is issued:
>ifconfig eth0 10.10.10.50 netmask 0xffffff00 broadcast 10.10.10.255
>
> The kernel sends the following three sets of messages on the netlink
>socket:
>
>Interface address delete: (with address 10.10.10.10)
>Interface address add   : (with address 10.10.10.50)
>
>Interface address delete: (with address 10.10.10.50)
>Interface address add   : (with address 10.10.10.50)
>
>Interface address delete: (with address 10.10.10.50)
>Interface address add   : (with address 10.10.10.50)
>
>Ideally as only the interface address is changed only one address
>delete/add should be sent.

State is not maintained in user space. You change that IP address,
it actually gets deleted then a new one added. The bcast and netmask
changeto defaults  as a result; you then change the netmask and
broadcast with each requiring a call from user space. If you modify your
netlink program to print both net and broadcast address you should see
this. BTW, you MUST check for these.

Example try just:
ifconfig eth0 10.10.10.50

and after you change it try:
ifconfig eth0 10.10.10.50 netmask 0xffffff00

and then
ifconfig eth0 10.10.10.50 netmask 0xffffff00 broadcast 10.10.10.255

cheers,
jamal

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PROBLEM: Interface address change netlink socket problem.(Patch
  2002-10-10  2:46 PROBLEM: Interface address change netlink socket problem.(Patch jamal
@ 2002-10-10  4:23 ` Vividh Siddha
  2002-10-10 12:03   ` jamal
  0 siblings, 1 reply; 3+ messages in thread
From: Vividh Siddha @ 2002-10-10  4:23 UTC (permalink / raw)
  To: jamal; +Cc: netdev, David S. Miller

Thats true but we are working around a problem which exists in the Linux 
stack. Ideally when we set only a interface address, the netmask should 
remain the same as it was before. Also the default netmasks based on 
classes might not be what is set. If we set netmask as /23, then:

ifconfig eth0 10.10.10.50

will cause the netmask to be /8. The end result of all of these is correct but the intermediate messages can cause problems in higher layer protocols.

vividh

jamal wrote:

>Moved to netdev where it belongs. Vividh in the future please post
>to netdev or at least cross-post to it ... because the kernel list
>FAQ says so.
>
>In your posting you say:
>  
>
>>Imagine a interface eth0 with address 10.10.10.10, netmask 0xffffff00
>>and broadcast 10.10.10.255.
>>
>>For eg: if the following command is issued:
>>ifconfig eth0 10.10.10.50 netmask 0xffffff00 broadcast 10.10.10.255
>>
>>The kernel sends the following three sets of messages on the netlink
>>socket:
>>
>>Interface address delete: (with address 10.10.10.10)
>>Interface address add   : (with address 10.10.10.50)
>>
>>Interface address delete: (with address 10.10.10.50)
>>Interface address add   : (with address 10.10.10.50)
>>
>>Interface address delete: (with address 10.10.10.50)
>>Interface address add   : (with address 10.10.10.50)
>>
>>Ideally as only the interface address is changed only one address
>>delete/add should be sent.
>>    
>>
>
>State is not maintained in user space. You change that IP address,
>it actually gets deleted then a new one added. The bcast and netmask
>changeto defaults  as a result; you then change the netmask and
>broadcast with each requiring a call from user space. If you modify your
>netlink program to print both net and broadcast address you should see
>this. BTW, you MUST check for these.
>
>Example try just:
>ifconfig eth0 10.10.10.50
>
>and after you change it try:
>ifconfig eth0 10.10.10.50 netmask 0xffffff00
>
>and then
>ifconfig eth0 10.10.10.50 netmask 0xffffff00 broadcast 10.10.10.255
>
>cheers,
>jamal
>
>
>  
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PROBLEM: Interface address change netlink socket problem.(Patch
  2002-10-10  4:23 ` Vividh Siddha
@ 2002-10-10 12:03   ` jamal
  0 siblings, 0 replies; 3+ messages in thread
From: jamal @ 2002-10-10 12:03 UTC (permalink / raw)
  To: Vividh Siddha; +Cc: netdev, David S. Miller



On Wed, 9 Oct 2002, Vividh Siddha wrote:

> Thats true but we are working around a problem which exists in the Linux
> stack. Ideally when we set only a interface address, the netmask should
> remain the same as it was before. Also the default netmasks based on
> classes might not be what is set. If we set netmask as /23, then:
>
> ifconfig eth0 10.10.10.50
>
> will cause the netmask to be /8. The end result of all of these is correct but the intermediate messages can cause problems in higher layer protocols.
>

calling it "a problem which exists on the linux stack" is pushing it ..
You pass three operations to ifconfig;
"change" ipaddr, "change" netmask, "change" broadcast.

1) There is no atomic "change" operator. It translates to "add" then
"delete" from userland.
2) You delete the IP address which as the primary piece of data resets
everything including netmask and broadcasts to defaults

There are 2 ways to formally and correctly do it:  introduce some
form of two-phase commit. You send all the commands to the kernel and then
send it a commit to tell it to make the changes. The other way to do it is
to introduce a change operator;
Both these two break BSD semantics. OTOH, you can do either by working
with netlink by  batching all three atomic operations and introducing some
new flags.

cheers,
jamal

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-10-10 12:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-10  2:46 PROBLEM: Interface address change netlink socket problem.(Patch jamal
2002-10-10  4:23 ` Vividh Siddha
2002-10-10 12:03   ` jamal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).