This commit is contained in:
Jiri Popelka 2012-11-30 17:27:08 +01:00
parent 30d17a887a
commit 9a66b7fd16
3 changed files with 10 additions and 4 deletions

View File

@ -188,7 +188,8 @@ int main(int argc, char *argv[])
struct ifreq if_hwaddr;
unsigned char *hwaddr = if_hwaddr.ifr_hwaddr.sa_data;
strcpy(if_hwaddr.ifr_name, ifname);
strncpy(if_hwaddr.ifr_name, ifname, IFNAMSIZ);
if_hwaddr.ifr_name[IFNAMSIZ-1] = '\0';
if (ioctl(s, SIOCGIFHWADDR, &if_hwaddr) < 0) {
fprintf(stderr, "SIOCGIFHWADDR on %s failed: %s\n", ifname,
strerror(errno));
@ -225,7 +226,8 @@ int main(int argc, char *argv[])
#if defined(PF_PACKET)
{
struct ifreq ifr;
strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
ifr.ifr_name[IFNAMSIZ-1] = '\0';
if (ioctl(s, SIOCGIFINDEX, &ifr) == -1) {
fprintf(stderr, "SIOCGIFINDEX on %s failed: %s\n", ifname,
strerror(errno));

View File

@ -246,6 +246,7 @@ main(int argc, char **argv)
u16 *data = (u16 *)(&ifr.ifr_data);
strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
ifr.ifr_name[IFNAMSIZ-1] = '\0';
data[0] = 0;
if (ioctl(skfd, 0x8947, &ifr) >= 0) {

View File

@ -3,10 +3,10 @@
Summary: Basic networking tools
Name: net-tools
Version: 2.0
Release: 0.3.%{checkout}%{?dist}
Release: 0.4.%{checkout}%{?dist}
License: GPLv2+
Group: System Environment/Base
URL: http://net-tools.sourceforge.net
URL: http://sourceforge.net/projects/net-tools/
# git archive --format=tar --remote=git://net-tools.git.sourceforge.net/gitroot/net-tools/net-tools master | xz > net-tools-%%{version}.%%{checkout}.tar.xz
Source0: net-tools-%{version}.%{checkout}.tar.xz
@ -168,6 +168,9 @@ install -m 644 %{SOURCE9} %{buildroot}%{_unitdir}
%attr(0644,root,root) %{_unitdir}/arp-ethers.service
%changelog
* Fri Nov 30 2012 Jiri Popelka <jpopelka@redhat.com> - 2.0-0.4.20121106git
- fix URL
* Fri Nov 16 2012 Jiri Popelka <jpopelka@redhat.com> - 2.0-0.3.20121106git
- match actual license