Problem with IP address deletion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi,

I would like to discuss a problem which I encountered with IP address deletion (using ip).

PROBLEM DESCRIPTION :

I added the dummy device addresses in the following sequence:

ip addr add 10.3.3.3/8 dev dummy0
ip addr add 10.3.3.3/32 dev dummy0

then I displayed the dummy0 device

ip addr show dummy0
2: dummy0: <BROADCAST,NOARP,UP> mtu 1500 qdisc noqueue
   link/ether 8a:d8:bd:26:14:ab brd ff:ff:ff:ff:ff:ff
   inet 10.3.3.3/8 scope global dummy0
   inet 10.3.3.3/32 scope global dummy0
   inet6 fe80::88d8:bdff:fe26:14ab/64 scope link
      valid_lft forever preferred_lft forever

then I deleted the second defined address  10.3.3.3/32 and then displayed the
dummy0 device again

ifconfig dummy0 10.3.3.3/32 down
ip addr show dummy0
2: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noqueue
   link/ether 8a:d8:bd:26:14:ab brd ff:ff:ff:ff:ff:ff
   inet 10.3.3.3/32 scope global dummy0

the first added address is deleted
then I deleted the first defined address 10.3.3.3/8

ifconfig dummy0 10.3.3.3/8 down
ip addr show dummy0
2: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noqueue
   link/ether 8a:d8:bd:26:14:ab brd ff:ff:ff:ff:ff:ff

The point of issue is. I'm able to add explicitly IP addresses with different
netmasks, which are handled as different addresses. But as soon as I try to
delete one of these addresses, the bit mask is unrelevant. The addresses are
deleted in the sequence; first in - first out, regardless which netmask I specify. This happens irrespective of the interface (eg. it happens for eth0 also ).


ANALYSIS :

For an address deletion request, "ip" (also the "ifconfig") sends the _local-address_ (IFA_LOCAL) but not the _global-address_(IFA_ADDRESS) attribute to the netlink protocol.

While in kernel, during address deletion, the prefix length is checked only if it is provided with a _global-address_(IFA_ADDRESS). Otherwise it matches _local-address_ only.

In the above trials, since the _addresses_ are same, the first matching _local-address_ gets deleted.

QUESTION :

Now which is wrong ?

The "ip" utility(and ifconfig), or the kernel ?

If "ip" is wrong, then I think all such similar utils follow the same mistake. So all of them needs to
be fixed.

Else, the kernel code needs the fix.


Could any one put some light one this ?

Thanks in advance,

--Suzuki K P




- : send the line "unsubscribe linux-net" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux