From a2fd71cba0dbe69f4abd5fe5786a0c6cdf62966b Mon Sep 17 00:00:00 2001 From: Reyk Floeter Date: Fri, 11 Aug 2017 15:12:33 +0000 Subject: Revision 1.139 accidentally removed an ip = mtod(), resulting in a pointless "ip = NULL; if (ip) ..." sequence. Coverity CID 1453286; Severity: Minor OK sthen@ tom@ --- sys/net/if_spppsubr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index 1c745073c65..c79a8e2f7b9 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_spppsubr.c,v 1.167 2017/08/11 13:23:27 reyk Exp $ */ +/* $OpenBSD: if_spppsubr.c,v 1.168 2017/08/11 15:12:32 reyk Exp $ */ /* * Synchronous PPP link level subroutines. * @@ -586,6 +586,9 @@ sppp_output(struct ifnet *ifp, struct mbuf *m, if (dst->sa_family == AF_INET) { struct ip *ip = NULL; + if (m->m_len >= sizeof(struct ip)) + ip = mtod(m, struct ip *); + /* * When using dynamic local IP address assignment by using * 0.0.0.0 as a local address, the first TCP session will -- cgit v1.2.3