diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2004-05-19 15:17:38 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2004-05-19 15:17:38 +0000 |
commit | ed8a707a71d8f91866eae75587de65d5289490ce (patch) | |
tree | b0da9fcce1f0995ac0888708a4af77d0308c2741 /perl-install/c/stuff.xs.pl | |
parent | b2b482c7034e5ff2df798920b54b2cb46b70a0a2 (diff) | |
download | drakx-ed8a707a71d8f91866eae75587de65d5289490ce.tar drakx-ed8a707a71d8f91866eae75587de65d5289490ce.tar.gz drakx-ed8a707a71d8f91866eae75587de65d5289490ce.tar.bz2 drakx-ed8a707a71d8f91866eae75587de65d5289490ce.tar.xz drakx-ed8a707a71d8f91866eae75587de65d5289490ce.zip |
(hasNetDevice, isNetDeviceWirelessAware, getNetDriver) explicitely use
system IFNAMSIZ instead of implicitely defining it
Diffstat (limited to 'perl-install/c/stuff.xs.pl')
-rw-r--r-- | perl-install/c/stuff.xs.pl | 6 |
1 files changed, 3 insertions, 3 deletions
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; |