Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108590315
D28705.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
758 B
Referenced Files
None
Subscribers
None
D28705.diff
View Options
diff --git a/sys/net/if.c b/sys/net/if.c
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1953,6 +1953,7 @@
struct ifaddr *ifa_maybe = NULL;
u_int af = addr->sa_family;
const char *addr_data = addr->sa_data, *cplim;
+ const struct sockaddr_dl *sdl;
NET_EPOCH_ASSERT();
/*
@@ -1960,9 +1961,14 @@
* so do that if we can.
*/
if (af == AF_LINK) {
- const struct sockaddr_dl *sdl = (const struct sockaddr_dl *)addr;
- if (sdl->sdl_index && sdl->sdl_index <= V_if_index)
- return (ifaddr_byindex(sdl->sdl_index));
+ sdl = (const struct sockaddr_dl *)addr;
+ if (sdl->sdl_index && sdl->sdl_index <= V_if_index) {
+ ifp = ifnet_byindex(sdl->sdl_index);
+ if (ifp == NULL)
+ return (NULL);
+
+ return (ifp->if_addr);
+ }
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 27, 5:27 PM (6 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16201742
Default Alt Text
D28705.diff (758 B)
Attached To
Mode
D28705: Fix ifa refcount leak in ifa_ifwithnet()
Attached
Detach File
Event Timeline
Log In to Comment