- add netdevice.h, fix x25

- fix ifconfig crash when interface name is too long (#190703)
This commit is contained in:
Radek Vokál 2006-05-09 09:27:14 +00:00
parent ec6a611576
commit 8124c94924
3 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,36 @@
diff -Naurp net-tools-1.60-ifconfig-new/lib/interface.c net-tools-1.60-ifconfig/lib/interface.c
--- net-tools-1.60-ifconfig-new/lib/interface.c 2006-03-23 07:02:48.000000000 +0100
+++ net-tools-1.60-ifconfig/lib/interface.c 2006-03-23 09:58:45.000000000 +0100
@@ -203,6 +203,7 @@ out:
static char *get_name(char *name, char *p)
{
+ int count = 0;
while (isspace(*p))
p++;
while (*p) {
@@ -211,8 +212,13 @@ static char *get_name(char *name, char *
if (*p == ':') { /* could be an alias */
char *dot = p, *dotname = name;
*name++ = *p++;
- while (isdigit(*p))
+ count++;
+ while (isdigit(*p)){
*name++ = *p++;
+ count++;
+ if (count == (IFNAMSIZ-1))
+ break;
+ }
if (*p != ':') { /* it wasn't, backup */
p = dot;
name = dotname;
@@ -223,6 +229,9 @@ static char *get_name(char *name, char *
break;
}
*name++ = *p++;
+ count++;
+ if (count == (IFNAMSIZ-1))
+ break;
}
*name++ = '\0';
return p;

View File

@ -0,0 +1,22 @@
--- net-tools-1.60/lib/fddi.c.netdevice 2000-03-05 12:26:02.000000000 +0100
+++ net-tools-1.60/lib/fddi.c 2006-05-09 11:19:51.000000000 +0200
@@ -26,6 +26,8 @@
#error "No FDDI Support in your current Kernelsource Tree."
#error "Disable HW Type FDDI"
#endif
+#include <linux/netdevice.h>
+#include <asm/byteorder.h>
#if __GLIBC__ >= 2
#include <netinet/if_fddi.h>
#else
--- net-tools-1.60/lib/x25_sr.c.netdevice 2000-05-20 15:38:10.000000000 +0200
+++ net-tools-1.60/lib/x25_sr.c 2006-05-09 11:20:15.000000000 +0200
@@ -77,7 +77,7 @@
rt.sigdigits=sigdigits;
/* x25_route_struct.address isn't type struct sockaddr_x25, Why? */
- memcpy(&rt.address, &sx25.sx25_addr, sizeof(x25_address));
+ memcpy(&rt.address, &sx25.sx25_addr, sizeof(struct x25_address));
while (*args) {
if (!strcmp(*args,"device") || !strcmp(*args,"dev")) {

View File

@ -65,6 +65,8 @@ Patch50: net-tools-1.60-ifconfig_man.patch
Patch51: net-tools-1.60-x25-proc.patch Patch51: net-tools-1.60-x25-proc.patch
Patch52: net-tools-1.60-sctp.patch Patch52: net-tools-1.60-sctp.patch
Patch53: net-tools-1.60-arp_man.patch Patch53: net-tools-1.60-arp_man.patch
Patch54: net-tools-1.60-ifconfig-long-iface-crasher.patch
Patch55: net-tools-1.60-netdevice.patch
BuildRoot: %{_tmppath}/%{name}-root BuildRoot: %{_tmppath}/%{name}-root
Requires(post,preun): chkconfig Requires(post,preun): chkconfig
@ -126,6 +128,8 @@ ifconfig, netstat, route, and others.
%patch51 -p1 -b .x25 %patch51 -p1 -b .x25
%patch52 -p1 -b .sctp %patch52 -p1 -b .sctp
%patch53 -p1 %patch53 -p1
%patch54 -p1 -b .long_iface
%patch55 -p1 -b .netdevice
cp %SOURCE2 ./config.h cp %SOURCE2 ./config.h
cp %SOURCE3 ./config.make cp %SOURCE3 ./config.make
@ -237,6 +241,10 @@ exit 0
%{_sysconfdir}/rc.d/init.d/netplugd %{_sysconfdir}/rc.d/init.d/netplugd
%changelog %changelog
* Tue May 09 2006 Radek Vokál <rvokal@redhat.com> - 1.60-70
- add netdevice.h, fix x25
- fix ifconfig crash when interface name is too long (#190703)
* Tue May 02 2006 Radek Vokál <rvokal@redhat.com> - 1.60-69 * Tue May 02 2006 Radek Vokál <rvokal@redhat.com> - 1.60-69
- fix arp man page to correspond to man ethers (#190425) - fix arp man page to correspond to man ethers (#190425)