On Sun, 2012-11-04 at 19:48 +0100, Cyril Brulebois wrote: > Steve Langasek <vor...@debian.org> (04/11/2012): > > Is there a way to get an event-based notification of this change, so > > ifupdown can listen for such an event rather than having to poll? > > TL;DR: I think so. > > <disclaimer>I don't know anything about the linux kernel</disclaimer>
Lies! > Looking at net/ipv6/addrconf.c we have for examples: > add_addr() > addrconf_dad_start() > > doing things like: > ifp->flags &= ~IFA_F_TENTATIVE; > ifp->flags &= ~(IFA_F_TENTATIVE|IFA_F_OPTIMISTIC|IFA_F_DADFAILED); > > It looks like ipv6_ifa_notify() is called upon changes. > > That one ends up calling inet6_ifa_notify(), which has things like > struct sk_buff, nlmsg_new(), rtnl_notify(). The last one is defined in > net/core/rtnetlink.c; it looks like somebody wants to hook oneself up > onto a netlink socket from userspace. Right, you must use rtnetlink. But that is no more portable than using socket options to reflect addresses for UDP. Ben. -- Ben Hutchings No political challenge can be met by shopping. - George Monbiot
signature.asc
Description: This is a digitally signed message part