Skip to content

Commit 18589f3

Browse files
Merge pull request #1052
rtnetlink: fix RTM_NEWLINK name resolution in debug
2 parents 7036e8f + c43ce52 commit 18589f3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/kernel.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -644,9 +644,11 @@ static const char * ni_rtnl_msg_type_names[RTM_MAX] = {
644644
const char *
645645
ni_rtnl_msg_type_to_name(unsigned int type, const char *unknown)
646646
{
647-
if (type > RTM_BASE && type < RTM_MAX)
648-
return ni_rtnl_msg_type_names[type];
649-
else
650-
return unknown;
647+
const char *name = NULL;
648+
649+
if (type >= RTM_BASE && type < RTM_MAX)
650+
name = ni_rtnl_msg_type_names[type];
651+
652+
return name ?: unknown;
651653
}
652654

0 commit comments

Comments
 (0)