FreeBSD Bugzilla – Attachment 210181 Details for
Bug 242746
ifconfig: Deleting (or re-setting) an IP address holds (leaks?) memory
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
diff (text/plain), 2.11 KB, created by
Mark Johnston
on 2019-12-23 19:01:45 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Mark Johnston
Created:
2019-12-23 19:01:45 UTC
Size:
2.11 KB
patch
obsolete
>commit c5cbf367e6773c34949ed5f24d974e4bd62d6b54 >Author: Mark Johnston <markjdb@gmail.com> >Date: Mon Dec 23 14:00:52 2019 -0500 > > Plug some ifaddr refcount leaks. > >diff --git a/sys/net/route.c b/sys/net/route.c >index f0ab4b801c53..c79e1bf6cb33 100644 >--- a/sys/net/route.c >+++ b/sys/net/route.c >@@ -903,7 +903,6 @@ rt_exportinfo(struct rtentry *rt, struct rt_addrinfo *info, int flags) > info->rti_flags = rt->rt_flags; > info->rti_ifp = rt->rt_ifp; > info->rti_ifa = rt->rt_ifa; >- ifa_ref(info->rti_ifa); > if (flags & NHR_REF) { > /* Do 'traditional' refcouting */ > if_ref(info->rti_ifp); >@@ -1631,9 +1630,12 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt, > error = rt_getifa_fib(info, fibnum); > if (error) > return (error); >+ } else { >+ ifa_ref(info->rti_ifa); > } > rt = uma_zalloc(V_rtzone, M_NOWAIT); > if (rt == NULL) { >+ ifa_free(info->rti_ifa); > return (ENOBUFS); > } > rt->rt_flags = RTF_UP | flags; >@@ -1642,6 +1644,7 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt, > * Add the gateway. Possibly re-malloc-ing the storage for it. > */ > if ((error = rt_setgate(rt, dst, gateway)) != 0) { >+ ifa_free(info->rti_ifa); > uma_zfree(V_rtzone, rt); > return (error); > } >@@ -1665,7 +1668,6 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt, > * examine the ifa and ifa->ifa_ifp if it so desires. > */ > ifa = info->rti_ifa; >- ifa_ref(ifa); > rt->rt_ifa = ifa; > rt->rt_ifp = ifa->ifa_ifp; > rt->rt_weight = 1; >@@ -2108,7 +2110,6 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fibnum) > * Do the actual request > */ > bzero((caddr_t)&info, sizeof(info)); >- ifa_ref(ifa); > info.rti_ifa = ifa; > info.rti_flags = flags | > (ifa->ifa_flags & ~IFA_RTSELF) | RTF_PINNED; >@@ -2122,7 +2123,6 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fibnum) > info.rti_info[RTAX_GATEWAY] = ifa->ifa_addr; > info.rti_info[RTAX_NETMASK] = netmask; > error = rtrequest1_fib(cmd, &info, &rt, fibnum); >- > if (error == 0 && rt != NULL) { > /* > * notify any listening routing agents of the change
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 242746
: 210181