tcp: Simplify ifdef logic in tcp_update_seqack_wnd()
This function has a block conditional on !snd_wnd_cap shortly before an snd_wnd_cap is statically false). Therefore, simplify this down to a single conditional with an else branch. While we're there, fix some improperly indented closing braces. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
4aff6f9392
commit
265b2099c7
1 changed files with 2 additions and 4 deletions
2
tcp.c
2
tcp.c
|
@ -1073,7 +1073,6 @@ int tcp_update_seqack_wnd(const struct ctx *c, struct tcp_tap_conn *conn,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAS_SND_WND
|
|
||||||
if ((conn->flags & LOCAL) || tcp_rtt_dst_low(conn)) {
|
if ((conn->flags & LOCAL) || tcp_rtt_dst_low(conn)) {
|
||||||
new_wnd_to_tap = tinfo->tcpi_snd_wnd;
|
new_wnd_to_tap = tinfo->tcpi_snd_wnd;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1081,7 +1080,6 @@ int tcp_update_seqack_wnd(const struct ctx *c, struct tcp_tap_conn *conn,
|
||||||
new_wnd_to_tap = MIN((int)tinfo->tcpi_snd_wnd,
|
new_wnd_to_tap = MIN((int)tinfo->tcpi_snd_wnd,
|
||||||
SNDBUF_GET(conn));
|
SNDBUF_GET(conn));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
new_wnd_to_tap = MIN(new_wnd_to_tap, MAX_WINDOW);
|
new_wnd_to_tap = MIN(new_wnd_to_tap, MAX_WINDOW);
|
||||||
if (!(conn->events & ESTABLISHED))
|
if (!(conn->events & ESTABLISHED))
|
||||||
|
|
Loading…
Reference in a new issue