tree-wide: replace if_indextoname() with format_ifname()

This commit is contained in:
Yu Watanabe
2019-05-29 14:21:19 +09:00
parent 7f686722f7
commit 518a66ec08
7 changed files with 29 additions and 22 deletions
+2 -2
View File
@@ -1389,7 +1389,7 @@ int socket_bind_to_ifname(int fd, const char *ifname) {
}
int socket_bind_to_ifindex(int fd, int ifindex) {
char ifname[IFNAMSIZ] = "";
char ifname[IF_NAMESIZE + 1];
assert(fd >= 0);
@@ -1407,7 +1407,7 @@ int socket_bind_to_ifindex(int fd, int ifindex) {
return -errno;
/* Fall back to SO_BINDTODEVICE on kernels < 5.0 which didn't have SO_BINDTOIFINDEX */
if (!if_indextoname(ifindex, ifname))
if (!format_ifname(ifindex, ifname))
return -errno;
return socket_bind_to_ifname(fd, ifname);