Skip to content

Commit d8d5179

Browse files
jukkarcarlescufi
authored andcommitted
net: tcp2: Fix mbedtls missing warnings
If CONFIG_NET_TCP_ISN_RFC6528 is disabled, then mbedtls include files are not available so check this. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 81b9ba3 commit d8d5179

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

subsys/net/ip/tcp2.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ LOG_MODULE_REGISTER(net_tcp, CONFIG_NET_TCP_LOG_LEVEL);
1212
#include <stdlib.h>
1313
#include <zephyr.h>
1414
#include <random/rand32.h>
15+
16+
#if defined(CONFIG_NET_TCP_ISN_RFC6528)
1517
#include <mbedtls/md5.h>
18+
#endif
1619
#include <net/net_pkt.h>
1720
#include <net/net_context.h>
1821
#include <net/udp.h>
@@ -1313,7 +1316,10 @@ static uint32_t tcpv6_init_isn(struct in6_addr *saddr,
13131316
}
13141317

13151318
memcpy(buf.key, unique_key, sizeof(buf.key));
1319+
1320+
#if IS_ENABLED(CONFIG_NET_TCP_ISN_RFC6528)
13161321
mbedtls_md5_ret((const unsigned char *)&buf, sizeof(buf), hash);
1322+
#endif
13171323

13181324
return seq_scale(UNALIGNED_GET((uint32_t *)&hash[0]));
13191325
}
@@ -1345,7 +1351,10 @@ static uint32_t tcpv4_init_isn(struct in_addr *saddr,
13451351
}
13461352

13471353
memcpy(buf.key, unique_key, sizeof(unique_key));
1354+
1355+
#if IS_ENABLED(CONFIG_NET_TCP_ISN_RFC6528)
13481356
mbedtls_md5_ret((const unsigned char *)&buf, sizeof(buf), hash);
1357+
#endif
13491358

13501359
return seq_scale(UNALIGNED_GET((uint32_t *)&hash[0]));
13511360
}

0 commit comments

Comments
 (0)