]> git.ozlabs.org Git - ppp.git/commitdiff
pppd: Replace IF_NAMESIZE by IFNAMSIZ for struct ifreq
authorPali Rohár <pali@kernel.org>
Sat, 31 Jul 2021 20:12:55 +0000 (22:12 +0200)
committerPali Rohár <pali@kernel.org>
Sat, 31 Jul 2021 20:12:55 +0000 (22:12 +0200)
Macros IF_NAMESIZE and IFNAMSIZ should be defined to the same value, but
struct ifreq uses IFNAMSIZ. So use "correct" macro.

Signed-off-by: Pali Rohár <pali@kernel.org>
pppd/sys-linux.c

index c68dbe1065b146d3c1a694ce55fd277e4a3ad53c..e1bb8108ea0964d81d0c4b64ead2132e97aa5889 100644 (file)
@@ -700,8 +700,8 @@ static int make_ppp_unit(void)
                char t[IFNAMSIZ];
                memset(&ifr, 0, sizeof(struct ifreq));
                slprintf(t, sizeof(t), "%s%d", PPP_DRV_NAME, ifunit);
-               strlcpy(ifr.ifr_name, t, IF_NAMESIZE);
-               strlcpy(ifr.ifr_newname, req_ifname, IF_NAMESIZE);
+               strlcpy(ifr.ifr_name, t, IFNAMSIZ);
+               strlcpy(ifr.ifr_newname, req_ifname, IFNAMSIZ);
                x = ioctl(sock_fd, SIOCSIFNAME, &ifr);
                if (x < 0)
                    error("Couldn't rename interface %s to %s: %m", t, req_ifname);