diff options
author | 2003-10-01 21:35:50 +0000 | |
---|---|---|
committer | 2003-10-01 21:35:50 +0000 | |
commit | 41509f843e476da6192cfa41462b31a2aaef3213 (patch) | |
tree | 8fb10251a30110b558d94dbe79518d55b9399b45 | |
parent | Fix stack leak into pfloghdr (the pad field is not initialized), (diff) | |
download | wireguard-openbsd-41509f843e476da6192cfa41462b31a2aaef3213.tar.xz wireguard-openbsd-41509f843e476da6192cfa41462b31a2aaef3213.zip |
correct m_cat misuse. i remember it was ok'ed by someone but don't remember who...
-rw-r--r-- | sys/netinet6/ip6_output.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 02700b3a372..2b7ed382a1e 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_output.c,v 1.76 2003/08/15 20:32:20 tedu Exp $ */ +/* $OpenBSD: ip6_output.c,v 1.77 2003/10/01 21:35:50 itojun Exp $ */ /* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */ /* @@ -862,6 +862,8 @@ ip6_output(m0, opt, ro, flags, im6o, ifpp) */ m0 = m; for (off = hlen; off < tlen; off += len) { + struct mbuf *mlast; + MGETHDR(m, M_DONTWAIT, MT_HEADER); if (!m) { error = ENOBUFS; @@ -892,7 +894,9 @@ ip6_output(m0, opt, ro, flags, im6o, ifpp) ip6stat.ip6s_odropped++; goto sendorfree; } - m_cat(m, m_frgpart); + for (mlast = m; mlast->m_next; mlast = mlast->m_next) + ; + mlast->m_next = m_frgpart; m->m_pkthdr.len = len + hlen + sizeof(*ip6f); m->m_pkthdr.rcvif = (struct ifnet *)0; ip6f->ip6f_reserved = 0; |