On Mon, Jan 12, 2015 at 03:00:41PM +0100, Martin Pieuchot wrote:
> @@ -1138,7 +1140,8 @@ rt_ifa_add(struct ifaddr *ifa, int flags
> * userland that a new address has been added.
> */
> if (flags & RTF_LOCAL)
> - rt_newaddrmsg(RTM_ADD, ifa, error, nrt);
> + rt_sendaddrmsg(nrt, RTM_NEWADDR);
> + rt_sendmsg(nrt, RTM_ADD, rtableid);
> }
> return (error);
> }
> @@ -1193,7 +1196,8 @@ rt_ifa_del(struct ifaddr *ifa, int flags
> error = rtrequest1(RTM_DELETE, &info, prio, &nrt, rtableid);
> if (error == 0 && (rt = nrt) != NULL) {
> if (flags & RTF_LOCAL)
> - rt_newaddrmsg(RTM_DELETE, ifa, error, nrt);
> + rt_sendaddrmsg(nrt, RTM_DELADDR);
> + rt_sendmsg(nrt, RTM_DELETE, rtableid);
> if (rt->rt_refcnt <= 0) {
> rt->rt_refcnt++;
> rtfree(rt);
The purpose of the pass 1,2 loop was to reverse the order of the
address and route message in the delete case. Although I don't
know wether the order is important to anybody, I would not change
the behavior.
Can we change the second chunk to this?
rt_sendmsg(nrt, RTM_DELETE, rtableid);
if (flags & RTF_LOCAL)
rt_sendaddrmsg(nrt, RTM_DELADDR);
otherwise OK bluhm@