net-tools/net-tools-1.60-nameif.patch
cvsdist 14587f6468 auto-import changelog data from net-tools-1.60-20.1.src.rpm
Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20.1
-rebuilt
Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20
- interface option now works as described in the man page (#61113).
Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19.1
- rebuilt
Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19
- Fixed trailing blank bug in hostname output (#101263).
- Remove -O2 fir alpha (#78955).
- Updated netstat statistic output, was still broken.
Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18.1
- rebuilt
Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18
- fix ether-wake.c build with gcc 3.3
- rebuilt
Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com>
- rebuilt
Wed Jun 04 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16.1
- Bumped release and rebuilt
Fri May 23 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16
- Fixed ether-wake usage output (#55801).
Thu May 22 2003 Jeremy Katz <katzj@redhat.com> 1.60-15
- fix build with gcc 3.3
Thu May 22 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-14
- Fixed wrong manpage (#55473).
Wed May 21 2003 Phil Knirsch <pknirsch@redhat.com>
- Added inet6-lookup patch from John van Krieken (#84108).
- Fixed outdated link in ifconfig manpage (#91287).
Tue May 20 2003 Phil Knirsch <pknirsch@redhat.com>
- Fixed incorrect address display for ipx (#46434).
- Fixed wrongly installed manpage dirs (#50664).
Wed Mar 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-13
- Fixed nameif problem (#85748).
2004-09-09 09:10:51 +00:00

68 lines
1.6 KiB
Diff

--- net-tools-1.60/nameif.c.nameif 2000-10-18 19:26:29.000000000 +0200
+++ net-tools-1.60/nameif.c 2003-03-19 11:02:01.000000000 +0100
@@ -3,7 +3,7 @@
* Writen 2000 by Andi Kleen.
* Subject to the Gnu Public License, version 2.
* TODO: make it support token ring etc.
- * $Id: nameif.c,v 1.1 2000/10/18 17:26:29 ak Exp $
+ * $Id: nameif.c,v 1.3 2003/03/06 23:26:52 ecki Exp $
*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
@@ -117,7 +117,8 @@
}
struct change {
- struct change *next,**pprev;
+ struct change *next;
+ int found;
char ifname[IFNAMSIZ+1];
unsigned char mac[6];
};
@@ -139,10 +140,7 @@
ch->ifname, pos);
if (parsemac(p,ch->mac) < 0)
complain(_("cannot parse MAC `%s' at %s"), p, pos);
- if (clist)
- clist->pprev = &ch->next;
ch->next = clist;
- ch->pprev = &clist;
clist = ch;
return 0;
}
@@ -200,7 +198,7 @@
void usage(void)
{
- fprintf(stderr, _("usage: nameif [-c configurationfile] [-s] {ifname macaddress}"));
+ fprintf(stderr, _("usage: nameif [-c configurationfile] [-s] {ifname macaddress}\n"));
exit(1);
}
@@ -277,21 +275,21 @@
ch = lookupmac(mac);
if (!ch)
continue;
-
- *ch->pprev = ch->next;
+
+ ch->found = 1;
if (strcmp(p, ch->ifname)) {
if (setname(p, ch->ifname) < 0)
complain(_("cannot change name of %s to %s: %s"),
p, ch->ifname, strerror(errno));
}
- free(ch);
}
fclose(ifh);
while (clist) {
struct change *ch = clist;
clist = clist->next;
- warning(_("interface '%s' not found"), ch->ifname);
+ if (!ch->found)
+ warning(_("interface '%s' not found"), ch->ifname);
free(ch);
}