From df47e4377bb3ecc5b7ed2b1ef011efe3ca6aeb46 Mon Sep 17 00:00:00 2001 From: Andre Oppermann Date: Fri, 20 Apr 2007 15:28:01 +0000 Subject: [PATCH] o Remove unncessary TOF_SIGLEN flag from struct tcpopt o Correctly set to->to_signature in tcp_dooptions() o Update comments --- sys/netinet/tcp_input.c | 3 ++- sys/netinet/tcp_reass.c | 3 ++- sys/netinet/tcp_var.h | 11 +++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 2658d592df4d..3cbc817609ae 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2716,7 +2716,8 @@ tcp_dooptions(struct tcpopt *to, u_char *cp, int cnt, int flags) case TCPOPT_SIGNATURE: if (optlen != TCPOLEN_SIGNATURE) continue; - to->to_flags |= (TOF_SIGNATURE | TOF_SIGLEN); + to->to_flags |= TOF_SIGNATURE; + to->to_signature = cp + 2; break; #endif case TCPOPT_SACK_PERMITTED: diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 2658d592df4d..3cbc817609ae 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -2716,7 +2716,8 @@ tcp_dooptions(struct tcpopt *to, u_char *cp, int cnt, int flags) case TCPOPT_SIGNATURE: if (optlen != TCPOLEN_SIGNATURE) continue; - to->to_flags |= (TOF_SIGNATURE | TOF_SIGLEN); + to->to_flags |= TOF_SIGNATURE; + to->to_signature = cp + 2; break; #endif case TCPOPT_SACK_PERMITTED: diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index fad4cf4eb181..9160c4829606 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -231,17 +231,16 @@ struct tcpopt { #define TOF_SCALE 0x0002 /* window scaling */ #define TOF_SACKPERM 0x0004 /* SACK permitted */ #define TOF_TS 0x0010 /* timestamp */ -#define TOF_SIGNATURE 0x0040 /* signature option present */ -#define TOF_SIGLEN 0x0080 /* signature length valid (RFC2385) */ -#define TOF_SACK 0x0100 /* Peer sent SACK option */ -#define TOF_MAXOPT 0x0200 - u_int32_t to_tsval; /* our new timestamp */ +#define TOF_SIGNATURE 0x0040 /* TCP-MD5 signature option (RFC2385) */ +#define TOF_SACK 0x0080 /* Peer sent SACK option */ +#define TOF_MAXOPT 0x0100 + u_int32_t to_tsval; /* new timestamp */ u_int32_t to_tsecr; /* reflected timestamp */ u_int16_t to_mss; /* maximum segment size */ u_int8_t to_wscale; /* window scaling */ u_int8_t to_nsacks; /* number of SACK blocks */ u_char *to_sacks; /* pointer to the first SACK blocks */ - u_char *to_signature; /* pointer to the MD5 signature */ + u_char *to_signature; /* pointer to the TCP-MD5 signature */ }; /*