diff options
| author | Yoshinobu Inoue <shin@FreeBSD.org> | 2000-02-09 00:34:40 +0000 |
|---|---|---|
| committer | Yoshinobu Inoue <shin@FreeBSD.org> | 2000-02-09 00:34:40 +0000 |
| commit | a683a7dd4f600574a9e62a1c8b11d6e03e612906 (patch) | |
| tree | deed6856329885e6240edb635949a0cb62af515e | |
| parent | d98d74772fefc1efcdf18d459e9e7a25ac9d5559 (diff) | |
Notes
| -rw-r--r-- | sys/netinet/tcp_output.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index bbae03fdc494..ae85e84ef327 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -530,8 +530,13 @@ send: } /*#ifdef DIAGNOSTIC*/ +#ifdef INET6 + if (max_linkhdr + hdrlen > MCLBYTES) + panic("tcphdr too big"); +#else if (max_linkhdr + hdrlen > MHLEN) panic("tcphdr too big"); +#endif /*#endif*/ /* @@ -567,10 +572,14 @@ send: goto out; } #ifdef INET6 - if (isipv6 && (MHLEN < hdrlen + max_linkhdr) && - MHLEN >= hdrlen) { - MH_ALIGN(m, hdrlen); - } else + if (MHLEN < hdrlen + max_linkhdr) { + MCLGET(m, M_DONTWAIT); + if ((m->m_flags & M_EXT) == 0) { + m_freem(m); + error = ENOBUFS; + goto out; + } + } #endif m->m_data += max_linkhdr; m->m_len = hdrlen; |
