diff --git a/.cvsignore b/.cvsignore index ac183f6..a12249d 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,3 +1,7 @@ net-tools-1.60.tar.bz2 netplug-1.2.7.tar.bz2 netplug-1.2.9.tar.bz2 +mii-diag.c +mii-diag.8 +ether-wake.c +etherwake.8 diff --git a/ether-wake.c b/ether-wake.c index 3a67d61..eef22a7 100644 --- a/ether-wake.c +++ b/ether-wake.c @@ -1,10 +1,10 @@ /* ether-wake.c: Send a magic packet to wake up sleeping machines. */ static char version_msg[] = -"ether-wake.c: v1.08 3/31/2003 Donald Becker, http://www.scyld.com/"; +"ether-wake.c: v1.09 11/12/2003 Donald Becker, http://www.scyld.com/"; static char brief_usage_msg[] = "usage: ether-wake [-i ] [-p aa:bb:cc:dd[:ee:ff]] 00:11:22:33:44:55\n" -" Use '-u' to see the complete set of options.\n"; +" Use '-u' to see the complete set of options.\n"; static char usage_msg[] = "usage: ether-wake [-i ] [-p aa:bb:cc:dd[:ee:ff]] 00:11:22:33:44:55\n" "\n" @@ -46,24 +46,9 @@ static char usage_msg[] = The author may be reached as becker@scyld, or C/O Scyld Computing Corporation - 410 Severn Ave., Suite 210 + 914 Bay Ridge Road, Suite 220 Annapolis MD 21403 - The single required parameter is the Ethernet MAC (station) address - of the machine to wake. This is typically retrieved with the 'arp' - program while the target machine is awake. - - Options: - -b Send wake-up packet to the broadcast address. - -D Increase the debug level. - -i ifname Use interface IFNAME instead of the default "eth0". - -p Append the four or six byte password PW to the packet. - A password is only required for a few adapter types. - The password may be specified in ethernet hex format - or dotted decimal (Internet address) - -p 00:22:44:66:88:aa - -p 192.168.1.1 - Notes: On some systems dropping root capability allows the process to be dumped, traced or debugged. @@ -74,7 +59,7 @@ static char usage_msg[] = doing so only works with adapters configured for unicast+broadcast Rx filter. That configuration consumes more power. */ - + #include #include #include @@ -112,9 +97,6 @@ extern int setsockopt __P ((int __fd, int __level, int __optname, #else /* New, correct head files. */ #include #endif -#ifdef USE_SENDMSG -#include -#endif u_char outpack[1000]; int outpack_sz = 0; @@ -177,7 +159,7 @@ int main(int argc, char *argv[]) #endif if (s < 0) { if (errno == EPERM) - fprintf(stderr, "etherwake: This program must be run as root.\n"); + fprintf(stderr, "ether-wake: This program must be run as root.\n"); else perror("ether-wake: socket"); perm_failure++; @@ -265,14 +247,14 @@ int main(int argc, char *argv[]) printf("Sendto worked ! %d.\n", i); #ifdef USE_SEND - if (bind(s, &whereto, sizeof(whereto)) < 0) + if (bind(s, (struct sockaddr *)&whereto, sizeof(whereto)) < 0) perror("bind"); else if (send(s, outpack, 100, 0) < 0) perror("send"); #endif #ifdef USE_SENDMSG { - struct msghdr msghdr; + struct msghdr msghdr = { 0,}; struct iovec iovector[1]; msghdr.msg_name = &whereto; msghdr.msg_namelen = sizeof(whereto); diff --git a/net-tools-1.60-trim_iface.patch b/net-tools-1.60-trim_iface.patch new file mode 100644 index 0000000..150722c --- /dev/null +++ b/net-tools-1.60-trim_iface.patch @@ -0,0 +1,31 @@ +--- net-tools-1.60/ifconfig.c.old 2005-03-30 10:14:03.000000000 +0200 ++++ net-tools-1.60/ifconfig.c 2005-03-30 10:40:50.000000000 +0200 +@@ -177,7 +177,7 @@ + + static void usage(void) + { +- fprintf(stderr, _("Usage:\n ifconfig [-a] [-i] [-v] [-s] [[]
]\n")); ++ fprintf(stderr, _("Usage:\n ifconfig [-a] [-v] [-s] [[]
]\n")); + #if HAVE_AFINET + fprintf(stderr, _(" [add
[/]]\n")); + fprintf(stderr, _(" [del
[/]]\n")); +--- net-tools-1.60/lib/interface.c.old 2005-03-30 10:14:03.000000000 +0200 ++++ net-tools-1.60/lib/interface.c 2005-03-30 11:05:38.000000000 +0200 +@@ -620,7 +620,7 @@ + + void ife_print_short(struct interface *ptr) + { +- printf("%-9.9s ", ptr->name); ++ printf("%-9s ", ptr->name); + printf("%5d %3d ", ptr->mtu, ptr->metric); + /* If needed, display the interface statistics. */ + if (ptr->statistics_valid) { +@@ -711,7 +711,7 @@ + if (hw == NULL) + hw = get_hwntype(-1); + +- printf(_("%-9.9s Link encap:%s "), ptr->name, hw->title); ++ printf(_("%-9s Link encap:%s "), ptr->name, hw->title); + /* For some hardware types (eg Ash, ATM) we don't print the + hardware address if it's null. */ + if (hw->print != NULL && (! (hw_null_address(hw, ptr->hwaddr) && diff --git a/net-tools.spec b/net-tools.spec index 76ec544..5aec7a0 100644 --- a/net-tools.spec +++ b/net-tools.spec @@ -3,7 +3,7 @@ Summary: Basic networking tools. Name: net-tools Version: 1.60 -Release: 49 +Release: 50 License: GPL Group: System Environment/Base Source0: http://www.tazenda.demon.co.uk/phil/net-tools/net-tools-%{version}.tar.bz2 @@ -12,6 +12,8 @@ Source2: net-tools-%{version}-config.h Source3: net-tools-%{version}-config.make Source4: ether-wake.c Source5: etherwake.8 +Source6: mii-diag.c +Source7: mii-diag.8 Patch1: net-tools-1.57-bug22040.patch Patch2: net-tools-1.60-miiioctl.patch Patch3: net-tools-1.60-manydevs.patch @@ -48,6 +50,7 @@ Patch35: net-tools-1.60-de.patch Patch36: netplug-1.2.9-execshield.patch Patch37: net-tools-1.60-pie.patch Patch38: net-tools-1.60-ifaceopt.patch +Patch39: net-tools-1.60-trim_iface.patch BuildRoot: %{_tmppath}/%{name}-root Requires(post,preun): chkconfig @@ -94,11 +97,14 @@ ifconfig, netstat, route, and others. %patch36 -p1 -b .execshield %patch37 -p1 -b .pie %patch38 -p1 -b .ifaceopt +%patch39 -p1 -b .trim-iface cp %SOURCE2 ./config.h cp %SOURCE3 ./config.make cp %SOURCE4 . cp %SOURCE5 ./man/en_US +cp %SOURCE6 . +cp %SOURCE7 ./man/en_US %ifarch alpha perl -pi -e "s|-O2||" Makefile @@ -138,6 +144,7 @@ export CFLAGS="$RPM_OPT_FLAGS $CFLAGS" make gcc $RPM_OPT_FLAGS -o ether-wake ether-wake.c +gcc $RPM_OPT_FLAGS -o mii-diag mii-diag.c pushd netplug-%{npversion} make popd @@ -151,6 +158,7 @@ mv man/pt_BR man/pt make BASEDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install install -m 755 ether-wake %{buildroot}/sbin +install -m 755 mii-diag %{buildroot}/sbin pushd netplug-%{npversion} make install prefix=$RPM_BUILD_ROOT \ @@ -197,6 +205,12 @@ exit 0 %{_sysconfdir}/rc.d/init.d/netplugd %changelog +* Wed Mar 30 2005 Radek Vokal 1.60-50 +- added mii-diag tool +- added newer ether-wake +- remove useless -i option from ifconfig +- stop trimming interface names (#152457) + * Wed Mar 16 2005 Elliot Lee - rebuilt diff --git a/sources b/sources index 9d86b19..36d1807 100644 --- a/sources +++ b/sources @@ -1,2 +1,6 @@ 888774accab40217dde927e21979c165 net-tools-1.60.tar.bz2 3bc8062d8033e3f897b015f2889ce5a9 netplug-1.2.9.tar.bz2 +64a9a08dd016d02b6af3deef3277ad98 mii-diag.c +8c6ac053fcab98a3fce2181e7da878ea mii-diag.8 +15fe21b9cac19a79649c41fa7919e888 ether-wake.c +f2b7a2b4aa35e711ad5ae8ca6cd96846 etherwake.8