diff options
author | andre <andre@FreeBSD.org> | 2008-04-07 18:43:59 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2008-04-07 18:43:59 +0000 |
commit | 6028637ec1995a37b1df00c45b0545263425a9b4 (patch) | |
tree | 7ee01527899d34cb44a9a74d065669e40af465fc /sys/netinet | |
parent | 589d19f2634501a0d87ee92b22535316a59c6250 (diff) | |
download | FreeBSD-src-6028637ec1995a37b1df00c45b0545263425a9b4.zip FreeBSD-src-6028637ec1995a37b1df00c45b0545263425a9b4.tar.gz |
Use #defines for TCP options padding after EOL to be consistent.
Reviewed by: bz
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/tcp.h | 2 | ||||
-rw-r--r-- | 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__)); |