1
0
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:
Andrey V. Elsukov 2020-11-11 15:53:36 +00:00
parent 6f5a960678
commit 2f4ffa9f72
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=367594

View File

@ -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 */