diff options
author | ume <ume@FreeBSD.org> | 2001-07-04 11:29:55 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2001-07-04 11:29:55 +0000 |
commit | 405f82e183b1e8d420836d6bc38a1ed0ee1b49c4 (patch) | |
tree | 28671837f1738a267e6a55bcd7ad7918e427fdf5 /sys | |
parent | eb2a428208013bb32cb8d63e0f8ec92d3af14458 (diff) | |
download | FreeBSD-src-405f82e183b1e8d420836d6bc38a1ed0ee1b49c4.zip FreeBSD-src-405f82e183b1e8d420836d6bc38a1ed0ee1b49c4.tar.gz |
adjust mbuf length right in route_output().
Obtained from: KAME
MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/rtsock.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 6588f56..67c79b6 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -483,13 +483,19 @@ flush: } if (rtm) { m_copyback(m, 0, rtm->rtm_msglen, (caddr_t)rtm); + if (m->m_pkthdr.len < rtm->rtm_msglen) { + m_freem(m); + m = NULL; + } else if (m->m_pkthdr.len > rtm->rtm_msglen) + m_adj(m, rtm->rtm_msglen - m->m_pkthdr.len); Free(rtm); } if (rp) rp->rcb_proto.sp_family = 0; /* Avoid us */ if (dst) route_proto.sp_protocol = dst->sa_family; - raw_input(m, &route_proto, &route_src, &route_dst); + if (m) + raw_input(m, &route_proto, &route_src, &route_dst); if (rp) rp->rcb_proto.sp_family = PF_ROUTE; } |