Skip to content

Commit afa0e00

Browse files
Ruslan Mstoijukkar
Ruslan Mstoi
authored andcommitted
net: ipv6: Fix crash from fragmented packets
Echo server crashes upon reception of fragmented packets. This occurs when fragmentation is enabled with the default prj.conf of echo server. The cause is that by default with logs disabled net_sprint_ipv6_addr returns NULL. Signed-off-by: Ruslan Mstoi <[email protected]>
1 parent 331659c commit afa0e00

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

subsys/net/ip/ipv6.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3268,10 +3268,12 @@ static bool reassembly_cancel(u32_t id,
32683268

32693269
static void reassembly_info(char *str, struct net_ipv6_reassembly *reass)
32703270
{
3271-
char out[NET_IPV6_ADDR_LEN];
32723271
int i, len;
32733272

3273+
#if NET_LOG_ENABLED > 0
3274+
char out[NET_IPV6_ADDR_LEN];
32743275
snprintk(out, sizeof(out), "%s", net_sprint_ipv6_addr(&reass->dst));
3276+
#endif
32753277

32763278
for (i = 0, len = 0; i < NET_IPV6_FRAGMENTS_MAX_PKT; i++) {
32773279
if (!reass->pkt[i]) {

0 commit comments

Comments
 (0)