summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2017-08-11 15:12:33 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2017-08-11 15:12:33 +0000
commita2fd71cba0dbe69f4abd5fe5786a0c6cdf62966b (patch)
treea5f6dd2445ec89c0eeaa6a5921ccd7fa122b98af
parentcb469c389786243037d2ea608e914b68733ba449 (diff)
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@
-rw-r--r--sys/net/if_spppsubr.c5
1 files changed, 4 insertions, 1 deletions
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