net: tcp: Fix build with CONFIG_NET_BUF_VARIABLE_DATA_SIZE

In case variable buffer length feature was enabled, the TCP stack did
not build due to unconditional references to CONFIG_NET_BUF_DATA_SIZE,
which is not avaialable in this configuration.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2022-11-15 14:19:05 +01:00 committed by Anas Nashif
commit 00269af3e6

View file

@ -40,7 +40,11 @@ static int tcp_window =
#if (CONFIG_NET_TCP_MAX_RECV_WINDOW_SIZE != 0)
CONFIG_NET_TCP_MAX_RECV_WINDOW_SIZE;
#else
#if defined(CONFIG_NET_BUF_FIXED_DATA_SIZE)
(CONFIG_NET_BUF_RX_COUNT * CONFIG_NET_BUF_DATA_SIZE) / 3;
#else
CONFIG_NET_BUF_DATA_POOL_SIZE / 3;
#endif /* CONFIG_NET_BUF_FIXED_DATA_SIZE */
#endif
#ifdef CONFIG_NET_TCP_RANDOMIZED_RTO
#define TCP_RTO_MS (conn->rto)
@ -2113,8 +2117,12 @@ static enum net_verdict tcp_in(struct tcp *conn, struct net_pkt *pkt)
/* Adjust the window so that we do not run out of bufs
* while waiting acks.
*/
#if defined(CONFIG_NET_BUF_FIXED_DATA_SIZE)
max_win = (CONFIG_NET_BUF_TX_COUNT *
CONFIG_NET_BUF_DATA_SIZE) / 3;
#else
max_win = CONFIG_NET_BUF_DATA_POOL_SIZE / 3;
#endif /* CONFIG_NET_BUF_FIXED_DATA_SIZE */
}
if (sndbuf_opt > 0) {