Skip to contentSkip to conversation

ipv6: Should inet6_addr_del consider IFA_F_MANAGETEMPADDR?

DISCUSSION Heiner Kallweit 2 participants 5 messages Apr 8, 2014 – Apr 9, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

I stumbled accross the fact that inet6_addr_add as well as inet6_addr_modify consider IFA_F_TEMPORARY whilst inet6_addr_del does not.

My understanding of IFA_F_MANAGETEMPADDR is that it allows userspace applications to deal with temporary addresses w/o having to create / track (and possibly delete) each and every temporary address.

This works fine when creating / modifying a global address. However when a global address is deleted the orphaned temporary addresses remain. Shouldn't the userspace be able to set IFA_F_MANAGETEMPADDR also for RTM_DELADDR to signalize that the kernel should delete all related temporary addresses as well?

It would be a rather small extension to manage_tempaddrs to add a "delete" parameter and set valid_lft=prefered_lft=0 for each temporary address if set.

Sorry if this was discussed before and I miss something.

Rgds,
Heiner

#1 lore raw

Am 08.04.2014 20:26, schrieb Heiner Kallweit:

Quoted 17 lines

I stumbled accross the fact that inet6_addr_add as well as inet6_addr_modify consider IFA_F_TEMPORARY whilst inet6_addr_del does not.

My understanding of IFA_F_MANAGETEMPADDR is that it allows userspace applications to deal with temporary addresses w/o having to create / track (and possibly delete) each and every temporary address.

This works fine when creating / modifying a global address. However when a global address is deleted the orphaned temporary addresses remain. Shouldn't the userspace be able to set IFA_F_MANAGETEMPADDR also for RTM_DELADDR to signalize that the kernel should delete all related temporary addresses as well?

It would be a rather small extension to manage_tempaddrs to add a "delete" parameter and set valid_lft=prefered_lft=0 for each temporary address if set.

Sorry if this was discussed before and I miss something.

Quoted 8 lines

Rgds,
Heiner

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Sorry, there is a typo. Of course IFA_F_MANAGETEMPADDR is meant in the first sentence too.

#2 lore raw
In reply to Heiner Kallweit

[cc Jiri + Thomas]

Hi!

Quoted 11 lines · Heiner Kallweit

I stumbled accross the fact that inet6_addr_add as well as inet6_addr_modify consider IFA_F_TEMPORARY whilst inet6_addr_del does not.

My understanding of IFA_F_MANAGETEMPADDR is that it allows userspace applications to deal with temporary addresses w/o having to create / track (and possibly delete) each and every temporary address.

This works fine when creating / modifying a global address. However when a global address is deleted the orphaned temporary addresses remain. Shouldn't the userspace be able to set IFA_F_MANAGETEMPADDR also for RTM_DELADDR to signalize that the kernel should delete all related temporary addresses as well?

Sure, that is possible. I guess it was not done already because inet6_addr_del did not handle IFA_FLAGS at all. But it should be a very tiny change to pass that flag down. Please submit an iproute patch along with your changes.

Quoted 2 lines

It would be a rather small extension to manage_tempaddrs to add a "delete" parameter and set valid_lft=prefered_lft=0 for each temporary address if set.

I think valid_lft=prefered_lft=0; manage_tempaddr(...); addrconf_verify_rtnl(); is enough to clean up the old temporary address. No need for a further flag.

Quoted 1 line

Sorry if this was discussed before and I miss something.

I don't remember a discussion about that. ;)

Bye,

Hannes

#3 lore raw

Am 08.04.2014 22:14, schrieb Hannes Frederic Sowa:

Quoted 12 lines

[cc Jiri + Thomas]

Hi!

Quoted 7 lines · Heiner Kallweit

I stumbled accross the fact that inet6_addr_add as well as inet6_addr_modify consider IFA_F_TEMPORARY whilst inet6_addr_del does not.

My understanding of IFA_F_MANAGETEMPADDR is that it allows userspace applications to deal with temporary addresses w/o having to create / track (and possibly delete) each and every temporary address.

Quoted 8 lines
Quoted 4 lines

This works fine when creating / modifying a global address. However when a global address is deleted the orphaned temporary addresses remain. Shouldn't the userspace be able to set IFA_F_MANAGETEMPADDR also for RTM_DELADDR to signalize that the kernel should delete all related temporary addresses as well?

Sure, that is possible. I guess it was not done already because inet6_addr_del did not handle IFA_FLAGS at all. But it should be a very tiny change to pass that flag down. Please submit an iproute patch along with your changes.

After a brief look at the source code of iproute2 it seems like "ip addr del" already supports sending IFA_F_MANAGETEMPADDR with RTM_DELADDR, though I have the impression it's unintentional.

The del command internally calls ipaddr_modify just like add / change / replace. And ipaddr_modify happily populates every flag provided on the command line w/o checking whether the flag is applicable for the respective command.

Having said this only the usage info needs to be extended.
Not sure: Should the related patch go to this mailing list or to Stephen directly who seems to be the current maintainer.

Quoted 5 lines
Quoted 2 lines

It would be a rather small extension to manage_tempaddrs to add a "delete" parameter and set valid_lft=prefered_lft=0 for each temporary address if set.

I think valid_lft=prefered_lft=0; manage_tempaddr(...); addrconf_verify_rtnl(); is enough to clean up the old temporary address. No need for a further flag.

Right .. Will prepare a patch.

Quoted 8 lines
Quoted 2 lines

Sorry if this was discussed before and I miss something.

I don't remember a discussion about that. ;)

Bye,

Hannes

Rgds, Heiner

#4 lore raw
Quoted 24 lines · Heiner Kallweit

Am 08.04.2014 22:14, schrieb Hannes Frederic Sowa:

Quoted 12 lines

[cc Jiri + Thomas]

Hi!

Quoted 7 lines · Heiner Kallweit

I stumbled accross the fact that inet6_addr_add as well as inet6_addr_modify consider IFA_F_TEMPORARY whilst inet6_addr_del does not.

My understanding of IFA_F_MANAGETEMPADDR is that it allows userspace applications to deal with temporary addresses w/o having to create / track (and possibly delete) each and every temporary address.

Quoted 8 lines
Quoted 4 lines

This works fine when creating / modifying a global address. However when a global address is deleted the orphaned temporary addresses remain. Shouldn't the userspace be able to set IFA_F_MANAGETEMPADDR also for RTM_DELADDR to signalize that the kernel should delete all related temporary addresses as well?

Sure, that is possible. I guess it was not done already because inet6_addr_del did not handle IFA_FLAGS at all. But it should be a very tiny change to pass that flag down. Please submit an iproute patch along with your changes.

After a brief look at the source code of iproute2 it seems like "ip addr del" already supports sending IFA_F_MANAGETEMPADDR with RTM_DELADDR, though I have the impression it's unintentional.

Quoted 7 lines

The del command internally calls ipaddr_modify just like add / change / replace. And ipaddr_modify happily populates every flag provided on the command line w/o checking whether the flag is applicable for the respective command.

Having said this only the usage info needs to be extended.
Not sure: Should the related patch go to this mailing list or to Stephen directly who seems to be the current maintainer.

iproute patches are handled the same way as kernel patches on this mailing list. Cc Stephen wouldn't hurt either. ;)

Bye,

Hannes