mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
Fix possible NULL pointer dereference.
lagg(4) replaces if_output method of its child interfaces and expects that this method can be called only by child interfaces. But it is possible that lagg_port_output() could be called by children of child interfaces. In this case ifnet's if_lagg field is NULL. Add check that lp is not NULL. Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC
This commit is contained in:
parent
6f5a960678
commit
2f4ffa9f72
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=367594
@ -1145,7 +1145,8 @@ lagg_port_output(struct ifnet *ifp, struct mbuf *m,
|
||||
switch (dst->sa_family) {
|
||||
case pseudo_AF_HDRCMPLT:
|
||||
case AF_UNSPEC:
|
||||
return ((*lp->lp_output)(ifp, m, dst, ro));
|
||||
if (lp != NULL)
|
||||
return ((*lp->lp_output)(ifp, m, dst, ro));
|
||||
}
|
||||
|
||||
/* drop any other frames */
|
||||
|
Loading…
Reference in New Issue
Block a user