From 6028637ec1995a37b1df00c45b0545263425a9b4 Mon Sep 17 00:00:00 2001 From: andre Date: Mon, 7 Apr 2008 18:43:59 +0000 Subject: Use #defines for TCP options padding after EOL to be consistent. Reviewed by: bz --- sys/netinet/tcp.h | 2 ++ sys/netinet/tcp_output.c | 4 ++-- 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__)); -- cgit v1.1