From bc12a09303d2aee39ef641250ea7852df2074b0a Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Mon, 15 Jan 2007 05:01:31 +0000 Subject: [PATCH] Update ip and tcp pointers after m_pullup(). Submitted by: Alexander Motin --- sys/netgraph/ng_tcpmss.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netgraph/ng_tcpmss.c b/sys/netgraph/ng_tcpmss.c index 88bcafa2d17c..ac951e6a7fdd 100644 --- a/sys/netgraph/ng_tcpmss.c +++ b/sys/netgraph/ng_tcpmss.c @@ -315,6 +315,7 @@ ng_tcpmss_rcvdata(hook_p hook, item_p item) /* Check mbuf packet size and arrange for IP+TCP header */ M_CHECK(iphlen - sizeof(struct ip) + sizeof(struct tcphdr)); + ip = mtod(m, struct ip *); tcp = (struct tcphdr *)((caddr_t )ip + iphlen); /* Check TCP header length. */ @@ -330,6 +331,8 @@ ng_tcpmss_rcvdata(hook_p hook, item_p item) priv->stats.SYNPkts++; M_CHECK(tcphlen - sizeof(struct tcphdr)); + ip = mtod(m, struct ip *); + tcp = (struct tcphdr *)((caddr_t )ip + iphlen); #undef M_CHECK