On Mon, Apr 23, 2018 at 04:38:12PM +0200, Florian Obser wrote: > any objections? otherwise I'll commit it with OK benno, kn
Not from me. OK claudio@ > On Thu, Apr 19, 2018 at 08:08:45AM +0200, Florian Obser wrote: > > On Wed, Apr 18, 2018 at 11:31:02PM +0200, Alexander Bluhm wrote: > > > On Wed, Apr 18, 2018 at 05:03:04PM +0200, Florian Obser wrote: > > > > @@ -1158,9 +1158,9 @@ rt_ifa_del(struct ifaddr *ifa, int flags, struct > > > > sockaddr *dst) > > > > error = rtrequest_delete(&info, prio, ifp, &rt, rtableid); > > > > if (error == 0) { > > > > rtm_send(rt, RTM_DELETE, 0, rtableid); > > > > - if (flags & RTF_LOCAL) > > > > - rtm_addr(rt, RTM_DELADDR, ifa); > > > > rtfree(rt); > > > > + if (flags & RTF_LOCAL) > > > > + rtm_addr(RTM_DELADDR, ifa); > > > > } > > > > m_free(m); > > > > > > > > > > Why do you change the order of rtfree() and rtm_addr()? > > > > > > Have you checked that the rt->rt_ifa is not holding the last reference > > > to ifa? Otherwise the ifafree() in rtfree() could free it. > > > > > > bluhm > > > > > > > I missread rtfree() for free(). Best to not do that. > > > > diff --git net/route.c net/route.c > > index 30c8def301d..fc8f5f3707a 100644 > > --- net/route.c > > +++ net/route.c > > @@ -1103,7 +1103,7 @@ rt_ifa_add(struct ifaddr *ifa, int flags, struct > > sockaddr *dst) > > * userland that a new address has been added. > > */ > > if (flags & RTF_LOCAL) > > - rtm_addr(rt, RTM_NEWADDR, ifa); > > + rtm_addr(RTM_NEWADDR, ifa); > > rtm_send(rt, RTM_ADD, 0, rtableid); > > rtfree(rt); > > } > > @@ -1159,7 +1159,7 @@ rt_ifa_del(struct ifaddr *ifa, int flags, struct > > sockaddr *dst) > > if (error == 0) { > > rtm_send(rt, RTM_DELETE, 0, rtableid); > > if (flags & RTF_LOCAL) > > - rtm_addr(rt, RTM_DELADDR, ifa); > > + rtm_addr(RTM_DELADDR, ifa); > > rtfree(rt); > > } > > m_free(m); > > diff --git net/route.h net/route.h > > index 9f5459a9a62..3c89348cb43 100644 > > --- net/route.h > > +++ net/route.h > > @@ -427,7 +427,7 @@ void rt_maskedcopy(struct sockaddr *, > > struct sockaddr *, struct sockaddr *); > > struct sockaddr *rt_plen2mask(struct rtentry *, struct sockaddr_in6 *); > > void rtm_send(struct rtentry *, int, int, unsigned int); > > -void rtm_addr(struct rtentry *, int, struct ifaddr *); > > +void rtm_addr(int, struct ifaddr *); > > void rtm_miss(int, struct rt_addrinfo *, int, uint8_t, u_int, int, > > u_int); > > int rt_setgate(struct rtentry *, struct sockaddr *, u_int); > > struct rtentry *rt_getll(struct rtentry *); > > diff --git net/rtsock.c net/rtsock.c > > index eb570e25698..c5590378259 100644 > > --- net/rtsock.c > > +++ net/rtsock.c > > @@ -1509,7 +1509,7 @@ rtm_ifchg(struct ifnet *ifp) > > * copies of it. > > */ > > void > > -rtm_addr(struct rtentry *rt, int cmd, struct ifaddr *ifa) > > +rtm_addr(int cmd, struct ifaddr *ifa) > > { > > struct ifnet *ifp = ifa->ifa_ifp; > > struct mbuf *m; > > > > > > -- > > I'm not entirely sure you are real. > > > > -- > I'm not entirely sure you are real. > -- :wq Claudio