summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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