From 8124c9492448714fc3726d8925fa7769463ebbf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Vok=C3=A1l?= Date: Tue, 9 May 2006 09:27:14 +0000 Subject: [PATCH] - add netdevice.h, fix x25 - fix ifconfig crash when interface name is too long (#190703) --- ...ols-1.60-ifconfig-long-iface-crasher.patch | 36 +++++++++++++++++++ net-tools-1.60-netdevice.patch | 22 ++++++++++++ net-tools.spec | 8 +++++ 3 files changed, 66 insertions(+) create mode 100644 net-tools-1.60-ifconfig-long-iface-crasher.patch create mode 100644 net-tools-1.60-netdevice.patch diff --git a/net-tools-1.60-ifconfig-long-iface-crasher.patch b/net-tools-1.60-ifconfig-long-iface-crasher.patch new file mode 100644 index 0000000..eaf2c5e --- /dev/null +++ b/net-tools-1.60-ifconfig-long-iface-crasher.patch @@ -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; diff --git a/net-tools-1.60-netdevice.patch b/net-tools-1.60-netdevice.patch new file mode 100644 index 0000000..08bdb58 --- /dev/null +++ b/net-tools-1.60-netdevice.patch @@ -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 ++#include + #if __GLIBC__ >= 2 + #include + #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")) { diff --git a/net-tools.spec b/net-tools.spec index 7173e5b..602403a 100644 --- a/net-tools.spec +++ b/net-tools.spec @@ -65,6 +65,8 @@ Patch50: net-tools-1.60-ifconfig_man.patch Patch51: net-tools-1.60-x25-proc.patch Patch52: net-tools-1.60-sctp.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 Requires(post,preun): chkconfig @@ -126,6 +128,8 @@ ifconfig, netstat, route, and others. %patch51 -p1 -b .x25 %patch52 -p1 -b .sctp %patch53 -p1 +%patch54 -p1 -b .long_iface +%patch55 -p1 -b .netdevice cp %SOURCE2 ./config.h cp %SOURCE3 ./config.make @@ -237,6 +241,10 @@ exit 0 %{_sysconfdir}/rc.d/init.d/netplugd %changelog +* Tue May 09 2006 Radek Vokál - 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 - 1.60-69 - fix arp man page to correspond to man ethers (#190425)