mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-07 22:12:08 +00:00
BUG/MINOR: tcp: don't try to set defaultmss when value is negative
when `getsockopt` previously failed, we were trying to set defaultmss
with -2 value.
this is a followup of github issue #499
this should be backported to all versions >= v1.8
Fixes: 153659f1ae
("MINOR: tcp: When binding socket, attempt to
reuse one from the old proc.")
Signed-off-by: William Dauchy <w.dauchy@criteo.com>
This commit is contained in:
parent
47e09dd034
commit
97a7bdac3e
@ -906,9 +906,9 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen)
|
||||
defaultmss = default_tcp6_maxseg;
|
||||
|
||||
getsockopt(fd, IPPROTO_TCP, TCP_MAXSEG, &tmpmaxseg, &len);
|
||||
if (tmpmaxseg != defaultmss && setsockopt(fd, IPPROTO_TCP,
|
||||
TCP_MAXSEG, &defaultmss,
|
||||
sizeof(defaultmss)) == -1) {
|
||||
if (defaultmss > 0 &&
|
||||
tmpmaxseg != defaultmss &&
|
||||
setsockopt(fd, IPPROTO_TCP, TCP_MAXSEG, &defaultmss, sizeof(defaultmss)) == -1) {
|
||||
msg = "cannot set MSS";
|
||||
err |= ERR_WARN;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user