[riot-notifications] [RIOT-OS/RIOT] net/netif: add function to get interface by name from a buffer (#16709)

Leandro Lanzieri notifications at github.com
Wed Aug 4 16:49:15 CEST 2021


@leandrolanzieri commented on this pull request.



> @@ -65,7 +65,8 @@ netif_t *netif_get_by_name(const char *name)
 
     while (node) {
        netif_get_name((netif_t *)node, tmp);
-       if (strncmp(name, tmp, CONFIG_NETIF_NAMELENMAX) == 0) {
+       size_t len = strlen(tmp);

Hmm but [the documentation](http://doc.riot-os.org/group__net__netif.html#ga21ea06eb0aa8db28b28a8248bcd2ef18) says:

>Supposed to be implemented by the networking module. name must be zero-terminated in the result!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16709#discussion_r682689735
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210804/9414881e/attachment.htm>


More information about the notifications mailing list