[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <baea7ed0-ba32-3cc0-3885-7b77a72cb409@s-terra.ru>
Date: Wed, 17 Feb 2021 19:06:26 +0300
From: Муравьев Александр
<amuravyev@...erra.ru>
To: <netdev@...r.kernel.org>
Subject: null terminating of IFLA_INFO_KIND/IFLA_IFNAME
Hi
A noob question that I haven't found an answer.
Just wanted to clarify a piece of iproute2 code.
ip/iplink.c:
> 1058 addattr_l(&req.n, sizeof(req), IFLA_INFO_KIND, type,
> 1059 strlen(type));
also ip/iplink.c:
> 1115 addattr_l(&req.n, sizeof(req),
> 1116 !check_ifname(name) ? IFLA_IFNAME : IFLA_ALT_IFNAME,
> 1117 name, strlen(name) + 1);
My question is why we skip terminating null character for IFLA_INFO_KIND
(the first case) and don't skip it for IFLA_IFNAME (the second case)? I
mean "strlen(type)" and "strlen(name) + 1".
--
Best regards,
Alexander Muravev
Powered by blists - more mailing lists