diff options
| author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2008-03-09 13:26:50 +0000 |
|---|---|---|
| committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2008-03-09 13:26:50 +0000 |
| commit | 413deb1262963534e4e683194b88cbd86820d225 (patch) | |
| tree | f2eb56053328506f279e9284baa172f2b2ba172a /sys/netinet/tcp_output.c | |
| parent | 08995e292e9870964bce2c1a8c008635b769c2c8 (diff) | |
Notes
Diffstat (limited to 'sys/netinet/tcp_output.c')
| -rw-r--r-- | sys/netinet/tcp_output.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 1c0ef90eeee4..44adab6e3857 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1386,9 +1386,17 @@ tcp_addoptions(struct tcpopt *to, u_char *optp) optlen += TCPOLEN_EOL; *optp++ = TCPOPT_EOL; } + /* + * According to RFC 793 (STD0007): + * "The content of the header beyond the End-of-Option option + * must be header padding (i.e., zero)." + * and later: "The padding is composed of zeros." + * While EOLs are zeros use an explicit 0x00 here to not confuse + * people with padding of EOLs. + */ while (optlen % 4) { - optlen += TCPOLEN_NOP; - *optp++ = TCPOPT_NOP; + optlen += 1; + *optp++ = 0x00; } KASSERT(optlen <= TCP_MAXOLEN, ("%s: TCP options too long", __func__)); |
