From ed8a707a71d8f91866eae75587de65d5289490ce Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 19 May 2004 15:17:38 +0000 Subject: (hasNetDevice, isNetDeviceWirelessAware, getNetDriver) explicitely use system IFNAMSIZ instead of implicitely defining it --- perl-install/c/stuff.xs.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'perl-install/c') diff --git a/perl-install/c/stuff.xs.pl b/perl-install/c/stuff.xs.pl index a80588e6c..dfa8732eb 100644 --- a/perl-install/c/stuff.xs.pl +++ b/perl-install/c/stuff.xs.pl @@ -417,7 +417,7 @@ hasNetDevice(device) int s = socket(AF_INET, SOCK_DGRAM, 0); if (s == -1) { RETVAL = 0; return; } - strcpy(req.ifr_name, device); + strncpy(req.ifr_name, device, IFNAMSIZ); RETVAL = ioctl(s, SIOCGIFFLAGS, &req) == 0; close(s); @@ -434,7 +434,7 @@ isNetDeviceWirelessAware(device) int s = socket(AF_INET, SOCK_DGRAM, 0); memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, device, sizeof(ifr.ifr_name)-1); + strncpy(ifr.ifr_name, device, IFNAMSIZ); RETVAL = ioctl(s, SIOCGIWNAME, &ifr) != -1; close(s); OUTPUT: @@ -452,7 +452,7 @@ getNetDriver(char* device) int s = socket(AF_INET, SOCK_DGRAM, 0); memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, device, sizeof(ifr.ifr_name)-1); + strncpy(ifr.ifr_name, device, IFNAMSIZ); drvinfo.cmd = ETHTOOL_GDRVINFO; ifr.ifr_data = (caddr_t) &drvinfo; -- cgit v1.2.1