Skip to content

Commit

Permalink
netinet6: prevent a crash on empty ifp
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Feb 28, 2022
1 parent 267a401 commit 6d44059
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sys/netinet6/ip6_output.c
Expand Up @@ -708,8 +708,11 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
in6_ifstat_inc(ifp, ifs6_out_discard);
goto bad;
}
if (ifp != NULL)
mtu = ifp->if_mtu;
if (ifp == NULL) {
error = EHOSTUNREACH;
goto bad;
}
mtu = ifp->if_mtu;
}
if (nh == NULL) {
/*
Expand Down

0 comments on commit 6d44059

Please sign in to comment.