summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp.h2
-rw-r--r--sys/netinet/tcp_output.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h
index e0133a7..0ba98b4 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 44adab6..f94b854 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -1395,8 +1395,8 @@ tcp_addoptions(struct tcpopt *to, u_char *optp)
* 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__));
OpenPOWER on IntegriCloud