Use #defines for TCP options padding after EOL to be consistent.
Reviewed by: bz
This commit is contained in:
parent
d227204d2d
commit
c343c524e1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=177986
@ -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
|
||||
|
@ -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__));
|
||||
|
Loading…
Reference in New Issue
Block a user