- added mii-diag tool

- added newer ether-wake
- remove useless -i option from ifconfig
- stop trimming interface names (#152457)
This commit is contained in:
Radek Vokál 2005-03-30 12:26:05 +00:00
parent 67d6967cb0
commit 7ab46c3af2
5 changed files with 61 additions and 26 deletions

View File

@ -1,3 +1,7 @@
net-tools-1.60.tar.bz2 net-tools-1.60.tar.bz2
netplug-1.2.7.tar.bz2 netplug-1.2.7.tar.bz2
netplug-1.2.9.tar.bz2 netplug-1.2.9.tar.bz2
mii-diag.c
mii-diag.8
ether-wake.c
etherwake.8

View File

@ -1,7 +1,7 @@
/* ether-wake.c: Send a magic packet to wake up sleeping machines. */ /* ether-wake.c: Send a magic packet to wake up sleeping machines. */
static char version_msg[] = 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[] = static char brief_usage_msg[] =
"usage: ether-wake [-i <ifname>] [-p aa:bb:cc:dd[:ee:ff]] 00:11:22:33:44:55\n" "usage: ether-wake [-i <ifname>] [-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";
@ -46,24 +46,9 @@ static char usage_msg[] =
The author may be reached as becker@scyld, or C/O The author may be reached as becker@scyld, or C/O
Scyld Computing Corporation Scyld Computing Corporation
410 Severn Ave., Suite 210 914 Bay Ridge Road, Suite 220
Annapolis MD 21403 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 <pw> 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: Notes:
On some systems dropping root capability allows the process to be On some systems dropping root capability allows the process to be
dumped, traced or debugged. dumped, traced or debugged.
@ -74,7 +59,7 @@ static char usage_msg[] =
doing so only works with adapters configured for unicast+broadcast Rx doing so only works with adapters configured for unicast+broadcast Rx
filter. That configuration consumes more power. filter. That configuration consumes more power.
*/ */
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
@ -112,9 +97,6 @@ extern int setsockopt __P ((int __fd, int __level, int __optname,
#else /* New, correct head files. */ #else /* New, correct head files. */
#include <sys/socket.h> #include <sys/socket.h>
#endif #endif
#ifdef USE_SENDMSG
#include <iovec.h>
#endif
u_char outpack[1000]; u_char outpack[1000];
int outpack_sz = 0; int outpack_sz = 0;
@ -177,7 +159,7 @@ int main(int argc, char *argv[])
#endif #endif
if (s < 0) { if (s < 0) {
if (errno == EPERM) 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 else
perror("ether-wake: socket"); perror("ether-wake: socket");
perm_failure++; perm_failure++;
@ -265,14 +247,14 @@ int main(int argc, char *argv[])
printf("Sendto worked ! %d.\n", i); printf("Sendto worked ! %d.\n", i);
#ifdef USE_SEND #ifdef USE_SEND
if (bind(s, &whereto, sizeof(whereto)) < 0) if (bind(s, (struct sockaddr *)&whereto, sizeof(whereto)) < 0)
perror("bind"); perror("bind");
else if (send(s, outpack, 100, 0) < 0) else if (send(s, outpack, 100, 0) < 0)
perror("send"); perror("send");
#endif #endif
#ifdef USE_SENDMSG #ifdef USE_SENDMSG
{ {
struct msghdr msghdr; struct msghdr msghdr = { 0,};
struct iovec iovector[1]; struct iovec iovector[1];
msghdr.msg_name = &whereto; msghdr.msg_name = &whereto;
msghdr.msg_namelen = sizeof(whereto); msghdr.msg_namelen = sizeof(whereto);

View File

@ -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] <interface> [[<AF>] <address>]\n"));
+ fprintf(stderr, _("Usage:\n ifconfig [-a] [-v] [-s] <interface> [[<AF>] <address>]\n"));
#if HAVE_AFINET
fprintf(stderr, _(" [add <address>[/<prefixlen>]]\n"));
fprintf(stderr, _(" [del <address>[/<prefixlen>]]\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) &&

View File

@ -3,7 +3,7 @@
Summary: Basic networking tools. Summary: Basic networking tools.
Name: net-tools Name: net-tools
Version: 1.60 Version: 1.60
Release: 49 Release: 50
License: GPL License: GPL
Group: System Environment/Base Group: System Environment/Base
Source0: http://www.tazenda.demon.co.uk/phil/net-tools/net-tools-%{version}.tar.bz2 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 Source3: net-tools-%{version}-config.make
Source4: ether-wake.c Source4: ether-wake.c
Source5: etherwake.8 Source5: etherwake.8
Source6: mii-diag.c
Source7: mii-diag.8
Patch1: net-tools-1.57-bug22040.patch Patch1: net-tools-1.57-bug22040.patch
Patch2: net-tools-1.60-miiioctl.patch Patch2: net-tools-1.60-miiioctl.patch
Patch3: net-tools-1.60-manydevs.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 Patch36: netplug-1.2.9-execshield.patch
Patch37: net-tools-1.60-pie.patch Patch37: net-tools-1.60-pie.patch
Patch38: net-tools-1.60-ifaceopt.patch Patch38: net-tools-1.60-ifaceopt.patch
Patch39: net-tools-1.60-trim_iface.patch
BuildRoot: %{_tmppath}/%{name}-root BuildRoot: %{_tmppath}/%{name}-root
Requires(post,preun): chkconfig Requires(post,preun): chkconfig
@ -94,11 +97,14 @@ ifconfig, netstat, route, and others.
%patch36 -p1 -b .execshield %patch36 -p1 -b .execshield
%patch37 -p1 -b .pie %patch37 -p1 -b .pie
%patch38 -p1 -b .ifaceopt %patch38 -p1 -b .ifaceopt
%patch39 -p1 -b .trim-iface
cp %SOURCE2 ./config.h cp %SOURCE2 ./config.h
cp %SOURCE3 ./config.make cp %SOURCE3 ./config.make
cp %SOURCE4 . cp %SOURCE4 .
cp %SOURCE5 ./man/en_US cp %SOURCE5 ./man/en_US
cp %SOURCE6 .
cp %SOURCE7 ./man/en_US
%ifarch alpha %ifarch alpha
perl -pi -e "s|-O2||" Makefile perl -pi -e "s|-O2||" Makefile
@ -138,6 +144,7 @@ export CFLAGS="$RPM_OPT_FLAGS $CFLAGS"
make make
gcc $RPM_OPT_FLAGS -o ether-wake ether-wake.c gcc $RPM_OPT_FLAGS -o ether-wake ether-wake.c
gcc $RPM_OPT_FLAGS -o mii-diag mii-diag.c
pushd netplug-%{npversion} pushd netplug-%{npversion}
make make
popd popd
@ -151,6 +158,7 @@ mv man/pt_BR man/pt
make BASEDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install make BASEDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install
install -m 755 ether-wake %{buildroot}/sbin install -m 755 ether-wake %{buildroot}/sbin
install -m 755 mii-diag %{buildroot}/sbin
pushd netplug-%{npversion} pushd netplug-%{npversion}
make install prefix=$RPM_BUILD_ROOT \ make install prefix=$RPM_BUILD_ROOT \
@ -197,6 +205,12 @@ exit 0
%{_sysconfdir}/rc.d/init.d/netplugd %{_sysconfdir}/rc.d/init.d/netplugd
%changelog %changelog
* Wed Mar 30 2005 Radek Vokal <rvokal@redhat.com> 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 <sopwith@redhat.com> * Wed Mar 16 2005 Elliot Lee <sopwith@redhat.com>
- rebuilt - rebuilt

View File

@ -1,2 +1,6 @@
888774accab40217dde927e21979c165 net-tools-1.60.tar.bz2 888774accab40217dde927e21979c165 net-tools-1.60.tar.bz2
3bc8062d8033e3f897b015f2889ce5a9 netplug-1.2.9.tar.bz2 3bc8062d8033e3f897b015f2889ce5a9 netplug-1.2.9.tar.bz2
64a9a08dd016d02b6af3deef3277ad98 mii-diag.c
8c6ac053fcab98a3fce2181e7da878ea mii-diag.8
15fe21b9cac19a79649c41fa7919e888 ether-wake.c
f2b7a2b4aa35e711ad5ae8ca6cd96846 etherwake.8