Page MenuHomeFreeBSD

D28705.diff
No OneTemporary

D28705.diff

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

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)

Event Timeline