projects
/
apple
/
xnu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
xnu-792.24.17.tar.gz
[apple/xnu.git]
/
bsd
/
netinet
/
ip_input.c
diff --git
a/bsd/netinet/ip_input.c
b/bsd/netinet/ip_input.c
index 96ad70ed7a6a1542331a0601f25c3fc24ba1c967..f567de39e488da39e42a107375369d7d7feb5181 100644
(file)
--- a/
bsd/netinet/ip_input.c
+++ b/
bsd/netinet/ip_input.c
@@
-2277,8
+2277,12
@@
ip_savecontrol(
ifnet_head_lock_shared();
if (((ifp = m->m_pkthdr.rcvif))
&& ( ifp->if_index && (ifp->if_index <= if_index))) {
ifnet_head_lock_shared();
if (((ifp = m->m_pkthdr.rcvif))
&& ( ifp->if_index && (ifp->if_index <= if_index))) {
- sdp = (struct sockaddr_dl *)(ifnet_addrs
- [ifp->if_index - 1]->ifa_addr);
+ struct ifaddr *ifa = ifnet_addrs[ifp->if_index - 1];
+
+ if (!ifa || !ifa->ifa_addr)
+ goto makedummy;
+
+ sdp = (struct sockaddr_dl *)ifa->ifa_addr;
/*
* Change our mind and don't try copy.
*/
/*
* Change our mind and don't try copy.
*/