summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Oppermann <andre@FreeBSD.org>2008-05-05 20:59:35 +0000
committerAndre Oppermann <andre@FreeBSD.org>2008-05-05 20:59:35 +0000
commitaa4df69aa4760cb93cfe695b8e6e62572948851a (patch)
tree27848b22487cb37543cacda0f3434530bdd5875b
parent12b89571ea4f40d0092cc0c98a48bb7ed08e1031 (diff)
Notes
-rw-r--r--sys/netinet/tcp.h2
-rw-r--r--sys/netinet/tcp_output.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h
index ee4fd1c2fe38..04f4302d44d0 100644
--- a/sys/netinet/tcp.h
+++ b/sys/netinet/tcp.h
@@ -78,6 +78,8 @@ struct tcphdr {
#define TCPOPT_EOL 0
#define TCPOLEN_EOL 1
+#define TCPOPT_PAD 0 /* padding after EOL */
+#define TCPOLEN_PAD 1
#define TCPOPT_NOP 1
#define TCPOLEN_NOP 1
#define TCPOPT_MAXSEG 2
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index 6c3d0734d430..051867583c89 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -1401,12 +1401,10 @@ tcp_addoptions(struct tcpopt *to, u_char *optp)
* "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 += 1;
- *optp++ = 0x00;
+ optlen += TCPOLEN_PAD;
+ *optp++ = TCPOPT_PAD;
}
KASSERT(optlen <= TCP_MAXOLEN, ("%s: TCP options too long", __func__));