Get index of address from netlink when network interface aliases are active

From: Андрей Аладьев
Date: Sun Jul 14 2013 - 06:40:15 EST


Steps:
1. create some network aliases. ifconfig command returns list
eth0
eth0:0
eth0:1
lo
2. create AF_NETLINK socket and send RTM_GETADDR message to it
3. received events:
RTM_NEWADDR
IFA_LABEL : "lo"
ifa_index : 0
RTM_NEWADDR
IFA_LABEL : "eth0"
ifa_index : 1
RTM_NEWADDR
IFA_LABEL : "eth0:0"
ifa_index : 1
RTM_NEWADDR
IFA_LABEL : "eth0:1"
ifa_index : 1
4. delete network alias "eth0:1", than "eth0:0"
5. received events
RTM_DELADDR
IFA_LABEL : "eth0:1"
ifa_index : 1
RTM_DELADDR
IFA_LABEL : "eth0:0"
ifa_index : 1

Is there a way to get right address index? I want to make one-to-one
correspondence between address and data pointer. Without right address
index I cant use simple dynamic array. I have to perform event's
address hashing and use hash table or tree.

Thank you.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/