3 patches merged upstream
removed 2digit.patch (#718610) removed fgets.patch (probably not needed anymore)
This commit is contained in:
parent
3f720650b5
commit
5bfa1044be
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@ net-tools-1.60.tar.bz2
|
|||||||
/net-tools-1.60.20111206git.tar.gz
|
/net-tools-1.60.20111206git.tar.gz
|
||||||
/net-tools-1.60.20111207git.tar.xz
|
/net-tools-1.60.20111207git.tar.xz
|
||||||
/net-tools-1.60.20120105git.tar.xz
|
/net-tools-1.60.20120105git.tar.xz
|
||||||
|
/net-tools-1.60.20120111git.tar.xz
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
diff -up net-tools-1.60/lib/util.c.2digit net-tools-1.60/lib/util.c
|
|
||||||
--- net-tools-1.60/lib/util.c.2digit 1999-01-09 16:55:29.000000000 +0100
|
|
||||||
+++ net-tools-1.60/lib/util.c 2011-07-04 12:35:45.000000000 +0200
|
|
||||||
@@ -33,13 +33,14 @@ void *xrealloc(void *oldp, size_t sz)
|
|
||||||
int kernel_version(void)
|
|
||||||
{
|
|
||||||
struct utsname uts;
|
|
||||||
- int major, minor, patch;
|
|
||||||
+ int ret, major = 0, minor = 0, patch = 0;
|
|
||||||
|
|
||||||
if (uname(&uts) < 0)
|
|
||||||
return -1;
|
|
||||||
- if (sscanf(uts.release, "%d.%d.%d", &major, &minor, &patch) != 3)
|
|
||||||
- return -1;
|
|
||||||
- return KRELEASE(major, minor, patch);
|
|
||||||
+ ret = sscanf(uts.release, "%d.%d.%d", &major, &minor, &patch);
|
|
||||||
+ if (((ret == 3) && (major >= 2)) || ((ret == 2) && (major >= 3)))
|
|
||||||
+ return KRELEASE(major, minor, patch);
|
|
||||||
+ return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
|||||||
diff -up net-tools-1.60/man/en_US/mii-tool.8.arbitrary-device-names net-tools-1.60/man/en_US/mii-tool.8
|
|
||||||
--- net-tools-1.60/man/en_US/mii-tool.8.arbitrary-device-names 2011-12-06 14:45:07.000000000 +0100
|
|
||||||
+++ net-tools-1.60/man/en_US/mii-tool.8 2011-12-06 14:47:48.406520671 +0100
|
|
||||||
@@ -16,7 +16,7 @@ mii\-tool \- view, manipulate media-inde
|
|
||||||
[\fB\-l\fR, \fB\-\-log\fR]
|
|
||||||
[\fB\-A\fR, \fB\-\-advertise=\fImedia,...\fR]
|
|
||||||
[\fB\-F\fR, \fB\-\-force=\fImedia\fR]
|
|
||||||
-.RI [ "interface\ ..." ]
|
|
||||||
+.RI "interface\ ..."
|
|
||||||
|
|
||||||
.SH NOTE
|
|
||||||
.P
|
|
||||||
@@ -42,9 +42,7 @@ one mode, instead of autonegotiating. T
|
|
||||||
options are mutually exclusive.
|
|
||||||
.PP
|
|
||||||
The default short output reports the negotiated link speed and link
|
|
||||||
-status for each interface. If an interface or interfaces are not
|
|
||||||
-specified on the command line, then \fBmii\-tool\fR will check any
|
|
||||||
-available interfaces from \fBeth0\fR through \fBeth7\fR.
|
|
||||||
+status for each interface.
|
|
||||||
.SH OPTIONS
|
|
||||||
.TP
|
|
||||||
\fB\-v\fR, \fB\-\-verbose\fR
|
|
||||||
diff -up net-tools-1.60/mii-tool.c.arbitrary-device-names net-tools-1.60/mii-tool.c
|
|
||||||
--- net-tools-1.60/mii-tool.c.arbitrary-device-names 2011-12-06 14:45:07.000000000 +0100
|
|
||||||
+++ net-tools-1.60/mii-tool.c 2011-12-06 14:53:39.823127359 +0100
|
|
||||||
@@ -424,7 +424,7 @@ static void watch_one_xcvr(int skfd, cha
|
|
||||||
/*--------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
const char *usage =
|
|
||||||
-"usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...]\n"
|
|
||||||
+"usage: %s [-VvRrwl] [-A media,... | -F media] <interface ...>\n"
|
|
||||||
" -V, --version display version information\n"
|
|
||||||
" -v, --verbose more verbose output\n"
|
|
||||||
" -R, --reset reset MII to poweron state\n"
|
|
||||||
@@ -491,13 +491,10 @@ int main(int argc, char **argv)
|
|
||||||
|
|
||||||
/* No remaining args means show all interfaces. */
|
|
||||||
if (optind == argc) {
|
|
||||||
- ret = 1;
|
|
||||||
- for (i = 0; i < MAX_ETH; i++) {
|
|
||||||
- sprintf(s, "eth%d", i);
|
|
||||||
- ret &= do_one_xcvr(skfd, s, 1);
|
|
||||||
- }
|
|
||||||
- if (ret)
|
|
||||||
- fprintf(stderr, "no MII interfaces found\n");
|
|
||||||
+ fprintf(stderr, "No interface specified\n");
|
|
||||||
+ fprintf(stderr, usage, argv[0]);
|
|
||||||
+ close(skfd);
|
|
||||||
+ return 2;
|
|
||||||
} else {
|
|
||||||
ret = 0;
|
|
||||||
for (i = optind; i < argc; i++) {
|
|
||||||
@@ -508,15 +505,8 @@ int main(int argc, char **argv)
|
|
||||||
if (opt_watch && (ret == 0)) {
|
|
||||||
while (1) {
|
|
||||||
sleep(1);
|
|
||||||
- if (optind == argc) {
|
|
||||||
- for (i = 0; i < MAX_ETH; i++) {
|
|
||||||
- sprintf(s, "eth%d", i);
|
|
||||||
- watch_one_xcvr(skfd, s, i);
|
|
||||||
- }
|
|
||||||
- } else {
|
|
||||||
- for (i = optind; i < argc; i++)
|
|
||||||
+ for (i = optind; i < argc; i++)
|
|
||||||
watch_one_xcvr(skfd, argv[i], i-optind);
|
|
||||||
- }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
|||||||
diff -up net-tools-1.60/arp.c.fgets net-tools-1.60/arp.c
|
|
||||||
--- net-tools-1.60/arp.c.fgets 2011-12-05 16:34:16.000000000 +0100
|
|
||||||
+++ net-tools-1.60/arp.c 2011-12-05 16:54:52.683352733 +0100
|
|
||||||
@@ -558,18 +558,21 @@ static int arp_show(char *name)
|
|
||||||
perror(_PATH_PROCNET_ARP);
|
|
||||||
return (-1);
|
|
||||||
}
|
|
||||||
+ /* Count number of entries, in case file changes */
|
|
||||||
+ for (entries = 0; fgets(line, sizeof(line), fp); entries++);
|
|
||||||
+ entries--;
|
|
||||||
+ fseek (fp, 0L, SEEK_SET);
|
|
||||||
/* Bypass header -- read until newline */
|
|
||||||
if (fgets(line, sizeof(line), fp) != (char *) NULL) {
|
|
||||||
strcpy(mask, "-");
|
|
||||||
strcpy(dev, "-");
|
|
||||||
/* Read the ARP cache entries. */
|
|
||||||
- for (; fgets(line, sizeof(line), fp);) {
|
|
||||||
- num = sscanf(line, "%s 0x%x 0x%x %99s %99s %99s\n",
|
|
||||||
- ip, &type, &flags, hwa, mask, dev);
|
|
||||||
- if (num < 4)
|
|
||||||
+ for (num = 0; num < entries; num++) {
|
|
||||||
+ fgets(line, sizeof(line), fp);
|
|
||||||
+ if (sscanf(line, "%s 0x%x 0x%x %99s %99s %99s\n",
|
|
||||||
+ ip, &type, &flags, hwa, mask, dev) < 4)
|
|
||||||
break;
|
|
||||||
|
|
||||||
- entries++;
|
|
||||||
/* if the user specified hw-type differs, skip it */
|
|
||||||
if (hw_set && (type != hw->type))
|
|
||||||
continue;
|
|
@ -1,31 +0,0 @@
|
|||||||
diff -up net-tools-1.60/lib/ib.c.ib-warning net-tools-1.60/lib/ib.c
|
|
||||||
--- net-tools-1.60/lib/ib.c.ib-warning 2011-11-21 02:31:57.000000000 +0100
|
|
||||||
+++ net-tools-1.60/lib/ib.c 2011-12-06 13:40:32.463976896 +0100
|
|
||||||
@@ -47,7 +47,10 @@ static const char *pr_ib(const char *ptr
|
|
||||||
pos += sprintf(pos, "%02X:", (*ptr++ & 0377));
|
|
||||||
}
|
|
||||||
buff[strlen(buff) - 1] = '\0';
|
|
||||||
-
|
|
||||||
+ char *ib_warning = "Ifconfig uses the ioctl access method to get the full address information, which limits hardware addresses to 8 bytes.\n"
|
|
||||||
+ "Because Infiniband address has 20 bytes, only the first 8 bytes are displayed correctly.\n"
|
|
||||||
+ "Ifconfig is obsolete! For replacement check ip.\n";
|
|
||||||
+ fprintf(stderr, _(ib_warning));
|
|
||||||
/* snprintf(buff, sizeof(buff), "%02X:%02X:%02X:%02X:%02X:%02X",
|
|
||||||
(ptr[0] & 0377), (ptr[1] & 0377), (ptr[2] & 0377),
|
|
||||||
(ptr[3] & 0377), (ptr[4] & 0377), (ptr[5] & 0377)
|
|
||||||
diff -up net-tools-1.60/man/en_US/ifconfig.8.ib-warning net-tools-1.60/man/en_US/ifconfig.8
|
|
||||||
--- net-tools-1.60/man/en_US/ifconfig.8.ib-warning 2011-12-06 13:40:31.000000000 +0100
|
|
||||||
+++ net-tools-1.60/man/en_US/ifconfig.8 2011-12-06 13:41:20.467376771 +0100
|
|
||||||
@@ -221,6 +221,12 @@ for more information.
|
|
||||||
.br
|
|
||||||
.I /proc/net/if_inet6
|
|
||||||
.SH BUGS
|
|
||||||
+Ifconfig uses obsolete kernel interface.
|
|
||||||
+It uses the ioctl access method to get the full address information,
|
|
||||||
+which limits hardware addresses to 8 bytes.
|
|
||||||
+Since an Infiniband address is 20 bytes,
|
|
||||||
+only the first 8 bytes of Infiniband address are displayed.
|
|
||||||
+.LP
|
|
||||||
While appletalk DDP and IPX addresses will be displayed they cannot be
|
|
||||||
altered by this command.
|
|
||||||
.SH SEE ALSO
|
|
@ -184,7 +184,7 @@ diff -up net-tools-1.60/man/en_US/mii-tool.8.man net-tools-1.60/man/en_US/mii-to
|
|||||||
+++ net-tools-1.60/man/en_US/mii-tool.8 2011-12-06 13:38:28.400527901 +0100
|
+++ net-tools-1.60/man/en_US/mii-tool.8 2011-12-06 13:38:28.400527901 +0100
|
||||||
@@ -18,6 +18,12 @@ mii\-tool \- view, manipulate media-inde
|
@@ -18,6 +18,12 @@ mii\-tool \- view, manipulate media-inde
|
||||||
[\fB\-F\fR, \fB\-\-force=\fImedia\fR]
|
[\fB\-F\fR, \fB\-\-force=\fImedia\fR]
|
||||||
.RI [ "interface\ ..." ]
|
.RI "interface\ ..."
|
||||||
|
|
||||||
+.SH NOTE
|
+.SH NOTE
|
||||||
+.P
|
+.P
|
||||||
|
@ -1,271 +0,0 @@
|
|||||||
diff -up net-tools-1.60/mii-tool.c.mii-registers net-tools-1.60/mii-tool.c
|
|
||||||
--- net-tools-1.60/mii-tool.c.mii-registers 2012-01-05 12:22:43.000000000 +0100
|
|
||||||
+++ net-tools-1.60/mii-tool.c 2012-01-05 13:14:54.462648840 +0100
|
|
||||||
@@ -51,10 +51,12 @@ static char Version[] = "$Id: mii-tool.c
|
|
||||||
#include <linux/if_arp.h>
|
|
||||||
#include <linux/if_ether.h>
|
|
||||||
#endif
|
|
||||||
-#include "mii.h"
|
|
||||||
+#include <linux/mii.h>
|
|
||||||
+#include <linux/sockios.h>
|
|
||||||
#include "version.h"
|
|
||||||
|
|
||||||
#define MAX_ETH 8 /* Maximum # of interfaces */
|
|
||||||
+#define LPA_ABILITY_MASK 0x07e0
|
|
||||||
|
|
||||||
/* Table of known MII's */
|
|
||||||
static const struct {
|
|
||||||
@@ -117,7 +119,7 @@ static struct ifreq ifr;
|
|
||||||
|
|
||||||
static int mdio_read(int skfd, int location)
|
|
||||||
{
|
|
||||||
- struct mii_data *mii = (struct mii_data *)&ifr.ifr_data;
|
|
||||||
+ struct mii_ioctl_data *mii = (struct mii_ioctl_data *)&ifr.ifr_data;
|
|
||||||
mii->reg_num = location;
|
|
||||||
if (ioctl(skfd, SIOCGMIIREG, &ifr) < 0) {
|
|
||||||
fprintf(stderr, "SIOCGMIIREG on %s failed: %s\n", ifr.ifr_name,
|
|
||||||
@@ -129,7 +131,7 @@ static int mdio_read(int skfd, int locat
|
|
||||||
|
|
||||||
static void mdio_write(int skfd, int location, int value)
|
|
||||||
{
|
|
||||||
- struct mii_data *mii = (struct mii_data *)&ifr.ifr_data;
|
|
||||||
+ struct mii_ioctl_data *mii = (struct mii_ioctl_data *)&ifr.ifr_data;
|
|
||||||
mii->reg_num = location;
|
|
||||||
mii->val_in = value;
|
|
||||||
if (ioctl(skfd, SIOCSMIIREG, &ifr) < 0) {
|
|
||||||
@@ -145,17 +147,17 @@ const struct {
|
|
||||||
u_short value[2];
|
|
||||||
} media[] = {
|
|
||||||
/* The order through 100baseT4 matches bits in the BMSR */
|
|
||||||
- { "10baseT-HD", {MII_AN_10BASET_HD} },
|
|
||||||
- { "10baseT-FD", {MII_AN_10BASET_FD} },
|
|
||||||
- { "100baseTx-HD", {MII_AN_100BASETX_HD} },
|
|
||||||
- { "100baseTx-FD", {MII_AN_100BASETX_FD} },
|
|
||||||
- { "100baseT4", {MII_AN_100BASET4} },
|
|
||||||
- { "100baseTx", {MII_AN_100BASETX_FD | MII_AN_100BASETX_HD} },
|
|
||||||
- { "10baseT", {MII_AN_10BASET_FD | MII_AN_10BASET_HD} },
|
|
||||||
-
|
|
||||||
- { "1000baseT-HD", {0, MII_BMCR2_1000HALF} },
|
|
||||||
- { "1000baseT-FD", {0, MII_BMCR2_1000FULL} },
|
|
||||||
- { "1000baseT", {0, MII_BMCR2_1000HALF|MII_BMCR2_1000FULL} },
|
|
||||||
+ { "10baseT-HD", {LPA_10HALF} },
|
|
||||||
+ { "10baseT-FD", {LPA_10FULL} },
|
|
||||||
+ { "100baseTx-HD", {LPA_100HALF} },
|
|
||||||
+ { "100baseTx-FD", {LPA_100FULL} },
|
|
||||||
+ { "100baseT4", {LPA_100BASE4} },
|
|
||||||
+ { "100baseTx", {LPA_100FULL | LPA_100HALF} },
|
|
||||||
+ { "10baseT", {LPA_10FULL | LPA_10HALF} },
|
|
||||||
+
|
|
||||||
+ { "1000baseT-HD", {0, ADVERTISE_1000HALF} },
|
|
||||||
+ { "1000baseT-FD", {0, ADVERTISE_1000FULL} },
|
|
||||||
+ { "1000baseT", {0, ADVERTISE_1000HALF|ADVERTISE_1000FULL} },
|
|
||||||
};
|
|
||||||
#define NMEDIA (sizeof(media)/sizeof(media[0]))
|
|
||||||
|
|
||||||
@@ -166,8 +168,8 @@ static int parse_media(char *arg, unsign
|
|
||||||
char *s;
|
|
||||||
mask = strtoul(arg, &s, 16);
|
|
||||||
if ((*arg != '\0') && (*s == '\0')) {
|
|
||||||
- if ((mask & MII_AN_ABILITY_MASK) &&
|
|
||||||
- !(mask & ~MII_AN_ABILITY_MASK)) {
|
|
||||||
+ if ((mask & LPA_ABILITY_MASK) &&
|
|
||||||
+ !(mask & ~LPA_ABILITY_MASK)) {
|
|
||||||
*bmcr2 = 0;
|
|
||||||
return mask;
|
|
||||||
}
|
|
||||||
@@ -198,18 +200,19 @@ static const char *media_list(unsigned m
|
|
||||||
int i;
|
|
||||||
*buf = '\0';
|
|
||||||
|
|
||||||
- if (mask & MII_BMCR_SPEED1000) {
|
|
||||||
- if (mask2 & MII_BMCR2_1000HALF) {
|
|
||||||
+ if (mask & BMCR_SPEED1000) {
|
|
||||||
+ if (mask2 & ADVERTISE_1000HALF) {
|
|
||||||
strcat(buf, " ");
|
|
||||||
strcat(buf, "1000baseT-HD");
|
|
||||||
if (best) goto out;
|
|
||||||
}
|
|
||||||
- if (mask2 & MII_BMCR2_1000FULL) {
|
|
||||||
+ if (mask2 & ADVERTISE_1000FULL) {
|
|
||||||
strcat(buf, " ");
|
|
||||||
strcat(buf, "1000baseT-FD");
|
|
||||||
if (best) goto out;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+
|
|
||||||
mask >>= 5;
|
|
||||||
for (i = 4; i >= 0; i--) {
|
|
||||||
if (mask & (1<<i)) {
|
|
||||||
@@ -233,8 +236,35 @@ int show_basic_mii(int sock, int phy_id)
|
|
||||||
/* Some bits in the BMSR are latched, but we can't rely on being
|
|
||||||
the only reader, so only the current values are meaningful */
|
|
||||||
mdio_read(sock, MII_BMSR);
|
|
||||||
- for (i = 0; i < ((verbose > 1) ? 32 : MII_BASIC_MAX); i++)
|
|
||||||
- mii_val[i] = mdio_read(sock, i);
|
|
||||||
+ for (i = 0; i < ((verbose > 1) ? 32 : (MII_STAT1000+1)); i++)
|
|
||||||
+ switch (i & 0x1F) {
|
|
||||||
+ case MII_BMCR:
|
|
||||||
+ case MII_BMSR:
|
|
||||||
+ case MII_PHYSID1:
|
|
||||||
+ case MII_PHYSID2:
|
|
||||||
+ case MII_ADVERTISE:
|
|
||||||
+ case MII_LPA:
|
|
||||||
+ case MII_EXPANSION:
|
|
||||||
+ case MII_CTRL1000:
|
|
||||||
+ case MII_STAT1000:
|
|
||||||
+ case MII_ESTATUS:
|
|
||||||
+ case MII_DCOUNTER:
|
|
||||||
+ case MII_FCSCOUNTER:
|
|
||||||
+ case MII_NWAYTEST:
|
|
||||||
+ case MII_RERRCOUNTER:
|
|
||||||
+ case MII_SREVISION:
|
|
||||||
+ case MII_RESV1:
|
|
||||||
+ case MII_LBRERROR:
|
|
||||||
+ case MII_PHYADDR:
|
|
||||||
+ case MII_RESV2:
|
|
||||||
+ case MII_TPISTATUS:
|
|
||||||
+ case MII_NCONFIG:
|
|
||||||
+ mii_val[i] = mdio_read(sock, i);
|
|
||||||
+ break;
|
|
||||||
+ default:
|
|
||||||
+ mii_val[i] = 0;
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
if (mii_val[MII_BMCR] == 0xffff || mii_val[MII_BMSR] == 0x0000) {
|
|
||||||
fprintf(stderr, " No MII transceiver present!.\n");
|
|
||||||
@@ -243,31 +273,31 @@ int show_basic_mii(int sock, int phy_id)
|
|
||||||
|
|
||||||
/* Descriptive rename. */
|
|
||||||
bmcr = mii_val[MII_BMCR]; bmsr = mii_val[MII_BMSR];
|
|
||||||
- advert = mii_val[MII_ANAR]; lkpar = mii_val[MII_ANLPAR];
|
|
||||||
+ advert = mii_val[MII_ADVERTISE]; lkpar = mii_val[MII_LPA];
|
|
||||||
bmcr2 = mii_val[MII_CTRL1000]; lpa2 = mii_val[MII_STAT1000];
|
|
||||||
|
|
||||||
sprintf(buf, "%s: ", ifr.ifr_name);
|
|
||||||
- if (bmcr & MII_BMCR_AN_ENA) {
|
|
||||||
- if (bmsr & MII_BMSR_AN_COMPLETE) {
|
|
||||||
+ if (bmcr & BMCR_ANENABLE) {
|
|
||||||
+ if (bmsr & BMSR_ANEGCOMPLETE) {
|
|
||||||
if (advert & lkpar) {
|
|
||||||
- strcat(buf, (lkpar & MII_AN_ACK) ?
|
|
||||||
+ strcat(buf, (lkpar & LPA_LPACK) ?
|
|
||||||
"negotiated" : "no autonegotiation,");
|
|
||||||
strcat(buf, media_list(advert & lkpar, bmcr2 & lpa2>>2, 1));
|
|
||||||
strcat(buf, ", ");
|
|
||||||
} else {
|
|
||||||
strcat(buf, "autonegotiation failed, ");
|
|
||||||
}
|
|
||||||
- } else if (bmcr & MII_BMCR_RESTART) {
|
|
||||||
+ } else if (bmcr & BMCR_ANRESTART) {
|
|
||||||
strcat(buf, "autonegotiation restarted, ");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
sprintf(buf+strlen(buf), "%s Mbit, %s duplex, ",
|
|
||||||
- ((bmcr2 & (MII_BMCR2_1000HALF | MII_BMCR2_1000FULL)) & lpa2 >> 2)
|
|
||||||
+ ((bmcr2 & (ADVERTISE_1000HALF | ADVERTISE_1000FULL)) & lpa2 >> 2)
|
|
||||||
? "1000"
|
|
||||||
- : (bmcr & MII_BMCR_100MBIT) ? "100" : "10",
|
|
||||||
- (bmcr & MII_BMCR_DUPLEX) ? "full" : "half");
|
|
||||||
+ : (bmcr & BMCR_SPEED100) ? "100" : "10",
|
|
||||||
+ (bmcr & BMCR_FULLDPLX) ? "full" : "half");
|
|
||||||
}
|
|
||||||
- strcat(buf, (bmsr & MII_BMSR_LINK_VALID) ? "link ok" : "no link");
|
|
||||||
+ strcat(buf, (bmsr & BMSR_LSTATUS) ? "link ok" : "no link");
|
|
||||||
|
|
||||||
if (opt_watch) {
|
|
||||||
if (opt_log) {
|
|
||||||
@@ -303,32 +333,32 @@ int show_basic_mii(int sock, int phy_id)
|
|
||||||
((mii_val[2]<<6)|(mii_val[3]>>10))&0xff,
|
|
||||||
(mii_val[3]>>4)&0x3f, mii_val[3]&0x0f);
|
|
||||||
printf(" basic mode: ");
|
|
||||||
- if (bmcr & MII_BMCR_RESET)
|
|
||||||
+ if (bmcr & BMCR_RESET)
|
|
||||||
printf("software reset, ");
|
|
||||||
- if (bmcr & MII_BMCR_LOOPBACK)
|
|
||||||
+ if (bmcr & BMCR_LOOPBACK)
|
|
||||||
printf("loopback, ");
|
|
||||||
- if (bmcr & MII_BMCR_ISOLATE)
|
|
||||||
+ if (bmcr & BMCR_ISOLATE)
|
|
||||||
printf("isolate, ");
|
|
||||||
- if (bmcr & MII_BMCR_COLTEST)
|
|
||||||
+ if (bmcr & BMCR_CTST)
|
|
||||||
printf("collision test, ");
|
|
||||||
- if (bmcr & MII_BMCR_AN_ENA) {
|
|
||||||
+ if (bmcr & BMCR_ANENABLE) {
|
|
||||||
printf("autonegotiation enabled\n");
|
|
||||||
} else {
|
|
||||||
printf("%s Mbit, %s duplex\n",
|
|
||||||
- (bmcr & MII_BMCR_100MBIT) ? "100" : "10",
|
|
||||||
- (bmcr & MII_BMCR_DUPLEX) ? "full" : "half");
|
|
||||||
+ (bmcr & BMCR_SPEED100) ? "100" : "10",
|
|
||||||
+ (bmcr & BMCR_FULLDPLX) ? "full" : "half");
|
|
||||||
}
|
|
||||||
printf(" basic status: ");
|
|
||||||
- if (bmsr & MII_BMSR_AN_COMPLETE)
|
|
||||||
+ if (bmsr & BMSR_ANEGCOMPLETE)
|
|
||||||
printf("autonegotiation complete, ");
|
|
||||||
- else if (bmcr & MII_BMCR_RESTART)
|
|
||||||
+ else if (bmcr & BMCR_ANRESTART)
|
|
||||||
printf("autonegotiation restarted, ");
|
|
||||||
- if (bmsr & MII_BMSR_REMOTE_FAULT)
|
|
||||||
+ if (bmsr & BMSR_RFAULT)
|
|
||||||
printf("remote fault, ");
|
|
||||||
- printf((bmsr & MII_BMSR_LINK_VALID) ? "link ok" : "no link");
|
|
||||||
+ printf((bmsr & BMSR_LSTATUS) ? "link ok" : "no link");
|
|
||||||
printf("\n capabilities:%s", media_list(bmsr >> 6, bmcr2, 0));
|
|
||||||
printf("\n advertising: %s", media_list(advert, bmcr2, 0));
|
|
||||||
- if (lkpar & MII_AN_ABILITY_MASK)
|
|
||||||
+ if (lkpar & LPA_ABILITY_MASK)
|
|
||||||
printf("\n link partner:%s", media_list(lkpar, lpa2 >> 2, 0));
|
|
||||||
printf("\n");
|
|
||||||
}
|
|
||||||
@@ -340,7 +370,7 @@ int show_basic_mii(int sock, int phy_id)
|
|
||||||
|
|
||||||
static int do_one_xcvr(int skfd, char *ifname, int maybe)
|
|
||||||
{
|
|
||||||
- struct mii_data *mii = (struct mii_data *)&ifr.ifr_data;
|
|
||||||
+ struct mii_ioctl_data *mii = (struct mii_ioctl_data *)&ifr.ifr_data;
|
|
||||||
|
|
||||||
/* Get the vitals from the interface. */
|
|
||||||
strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
|
|
||||||
@@ -358,23 +388,23 @@ static int do_one_xcvr(int skfd, char *i
|
|
||||||
|
|
||||||
if (opt_reset) {
|
|
||||||
printf("resetting the transceiver...\n");
|
|
||||||
- mdio_write(skfd, MII_BMCR, MII_BMCR_RESET);
|
|
||||||
+ mdio_write(skfd, MII_BMCR, BMCR_RESET);
|
|
||||||
}
|
|
||||||
if (nway_advertise > 0) {
|
|
||||||
- mdio_write(skfd, MII_ANAR, nway_advertise | 1);
|
|
||||||
+ mdio_write(skfd, MII_ADVERTISE, nway_advertise | 1);
|
|
||||||
opt_restart = 1;
|
|
||||||
}
|
|
||||||
if (opt_restart) {
|
|
||||||
printf("restarting autonegotiation...\n");
|
|
||||||
mdio_write(skfd, MII_BMCR, 0x0000);
|
|
||||||
- mdio_write(skfd, MII_BMCR, MII_BMCR_AN_ENA|MII_BMCR_RESTART);
|
|
||||||
+ mdio_write(skfd, MII_BMCR, BMCR_ANENABLE|BMCR_ANRESTART);
|
|
||||||
}
|
|
||||||
if (fixed_speed) {
|
|
||||||
int bmcr = 0;
|
|
||||||
- if (fixed_speed & (MII_AN_100BASETX_FD|MII_AN_100BASETX_HD))
|
|
||||||
- bmcr |= MII_BMCR_100MBIT;
|
|
||||||
- if (fixed_speed & (MII_AN_100BASETX_FD|MII_AN_10BASET_FD))
|
|
||||||
- bmcr |= MII_BMCR_DUPLEX;
|
|
||||||
+ if (fixed_speed & (LPA_100FULL|LPA_100HALF))
|
|
||||||
+ bmcr |= BMCR_SPEED100;
|
|
||||||
+ if (fixed_speed & (LPA_100FULL|LPA_10FULL))
|
|
||||||
+ bmcr |= BMCR_FULLDPLX;
|
|
||||||
mdio_write(skfd, MII_BMCR, bmcr);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -388,7 +418,7 @@ static int do_one_xcvr(int skfd, char *i
|
|
||||||
|
|
||||||
static void watch_one_xcvr(int skfd, char *ifname, int index)
|
|
||||||
{
|
|
||||||
- struct mii_data *mii = (struct mii_data *)&ifr.ifr_data;
|
|
||||||
+ struct mii_ioctl_data *mii = (struct mii_ioctl_data *)&ifr.ifr_data;
|
|
||||||
static int status[MAX_ETH] = { 0, /* ... */ };
|
|
||||||
int now;
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
|||||||
%global checkout 20120105git
|
%global checkout 20120111git
|
||||||
|
|
||||||
Summary: Basic networking tools
|
Summary: Basic networking tools
|
||||||
Name: net-tools
|
Name: net-tools
|
||||||
Version: 1.60
|
Version: 1.60
|
||||||
Release: 131.%{checkout}%{?dist}
|
Release: 132.%{checkout}%{?dist}
|
||||||
License: GPL+
|
License: GPL+
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
URL: http://net-tools.sourceforge.net
|
URL: http://net-tools.sourceforge.net
|
||||||
@ -50,30 +50,14 @@ Patch9: net-tools-1.60-interface_stack.patch
|
|||||||
# new option for nestat, -Z shows selinux context
|
# new option for nestat, -Z shows selinux context
|
||||||
Patch10: net-tools-1.60-selinux.patch
|
Patch10: net-tools-1.60-selinux.patch
|
||||||
|
|
||||||
# remove duplicate arp entries (#185604)
|
|
||||||
Patch11: net-tools-1.60-fgets.patch
|
|
||||||
|
|
||||||
# statistics for SCTP
|
# statistics for SCTP
|
||||||
Patch12: net-tools-1.60-sctp-statistics.patch
|
Patch11: net-tools-1.60-sctp-statistics.patch
|
||||||
|
|
||||||
# ifconfig crash when interface name is too long (#190703)
|
# ifconfig crash when interface name is too long (#190703)
|
||||||
Patch13: net-tools-1.60-ifconfig-long-iface-crasher.patch
|
Patch12: net-tools-1.60-ifconfig-long-iface-crasher.patch
|
||||||
|
|
||||||
# fixed tcp timers info in netstat (#466845)
|
# fixed tcp timers info in netstat (#466845)
|
||||||
Patch14: net-tools-1.60-netstat-probe.patch
|
Patch13: net-tools-1.60-netstat-probe.patch
|
||||||
|
|
||||||
# let the user know that ifconfig can correctly show only first 8 bytes of Infiniband hw address
|
|
||||||
Patch15: net-tools-1.60-ib-warning.patch
|
|
||||||
|
|
||||||
# use <linux/mii.h> instead of "mii.h" and fix Bug #491358
|
|
||||||
Patch16: net-tools-1.60-mii-registers.patch
|
|
||||||
|
|
||||||
# Don't rely on eth0 being default network device name.
|
|
||||||
# Since Fedora 15 network devices can have arbitrary names (#682367)
|
|
||||||
Patch17: net-tools-1.60-arbitrary-device-names.patch
|
|
||||||
|
|
||||||
# Update for 2 digit Linux version numbers (#718610)
|
|
||||||
Patch18: net-tools-1.60-2digit.patch
|
|
||||||
|
|
||||||
BuildRequires: gettext, libselinux
|
BuildRequires: gettext, libselinux
|
||||||
BuildRequires: libselinux-devel
|
BuildRequires: libselinux-devel
|
||||||
@ -98,14 +82,9 @@ Most of them are obsolete. For replacement check iproute package.
|
|||||||
%patch8 -p1 -b .trim-iface
|
%patch8 -p1 -b .trim-iface
|
||||||
%patch9 -p1 -b .stack
|
%patch9 -p1 -b .stack
|
||||||
%patch10 -p1 -b .selinux
|
%patch10 -p1 -b .selinux
|
||||||
%patch11 -p1 -b .fgets
|
%patch11 -p1 -b .sctp
|
||||||
%patch12 -p1 -b .sctp
|
%patch12 -p1 -b .long_iface
|
||||||
%patch13 -p1 -b .long_iface
|
%patch13 -p1 -b .probe
|
||||||
%patch14 -p1 -b .probe
|
|
||||||
%patch15 -p1 -b .ib-warning
|
|
||||||
%patch16 -p1 -b .mii-registers
|
|
||||||
%patch17 -p1 -b .arbitrary-device-names
|
|
||||||
%patch18 -p1 -b .2digit
|
|
||||||
|
|
||||||
cp %SOURCE1 ./config.h
|
cp %SOURCE1 ./config.h
|
||||||
cp %SOURCE2 ./config.make
|
cp %SOURCE2 ./config.make
|
||||||
@ -120,34 +99,17 @@ cp %SOURCE8 ./man/en_US
|
|||||||
perl -pi -e "s|-O2||" Makefile
|
perl -pi -e "s|-O2||" Makefile
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
#man pages conversion
|
#man pages conversion to utf-8
|
||||||
#french
|
#french
|
||||||
iconv -f iso-8859-1 -t utf-8 -o arp.tmp man/fr_FR/arp.8 && mv arp.tmp man/fr_FR/arp.8
|
for file in arp.8 ethers.5 ifconfig.8 netstat.8 plipconfig.8 route.8 slattach.8; do
|
||||||
iconv -f iso-8859-1 -t utf-8 -o ethers.tmp man/fr_FR/ethers.5 && mv ethers.tmp man/fr_FR/ethers.5
|
iconv -f ISO-8859-1 -t UTF-8 -o ${file}.new man/fr_FR/${file} && \
|
||||||
iconv -f iso-8859-1 -t utf-8 -o hostname.tmp man/fr_FR/hostname.1 && mv hostname.tmp man/fr_FR/hostname.1
|
mv ${file}.new man/fr_FR/${file}
|
||||||
iconv -f iso-8859-1 -t utf-8 -o ifconfig.tmp man/fr_FR/ifconfig.8 && mv ifconfig.tmp man/fr_FR/ifconfig.8
|
done
|
||||||
iconv -f iso-8859-1 -t utf-8 -o netstat.tmp man/fr_FR/netstat.8 && mv netstat.tmp man/fr_FR/netstat.8
|
|
||||||
iconv -f iso-8859-1 -t utf-8 -o plipconfig.tmp man/fr_FR/plipconfig.8 && mv plipconfig.tmp man/fr_FR/plipconfig.8
|
|
||||||
iconv -f iso-8859-1 -t utf-8 -o rarp.tmp man/fr_FR/rarp.8 && mv rarp.tmp man/fr_FR/rarp.8
|
|
||||||
iconv -f iso-8859-1 -t utf-8 -o route.tmp man/fr_FR/route.8 && mv route.tmp man/fr_FR/route.8
|
|
||||||
iconv -f iso-8859-1 -t utf-8 -o slattach.tmp man/fr_FR/slattach.8 && mv slattach.tmp man/fr_FR/slattach.8
|
|
||||||
#portugal
|
#portugal
|
||||||
iconv -f iso-8859-1 -t utf-8 -o arp.tmp man/pt_BR/arp.8 && mv arp.tmp man/pt_BR/arp.8
|
for file in arp.8 ifconfig.8 netstat.8 route.8; do
|
||||||
iconv -f iso-8859-1 -t utf-8 -o hostname.tmp man/pt_BR/hostname.1 && mv hostname.tmp man/pt_BR/hostname.1
|
iconv -f ISO-8859-1 -t UTF-8 -o ${file}.new man/pt_BR/${file} && \
|
||||||
iconv -f iso-8859-1 -t utf-8 -o ifconfig.tmp man/pt_BR/ifconfig.8 && mv ifconfig.tmp man/pt_BR/ifconfig.8
|
mv ${file}.new man/pt_BR/${file}
|
||||||
iconv -f iso-8859-1 -t utf-8 -o netstat.tmp man/pt_BR/netstat.8 && mv netstat.tmp man/pt_BR/netstat.8
|
done
|
||||||
iconv -f iso-8859-1 -t utf-8 -o rarp.tmp man/pt_BR/rarp.8 && mv rarp.tmp man/pt_BR/rarp.8
|
|
||||||
iconv -f iso-8859-1 -t utf-8 -o route.tmp man/pt_BR/route.8 && mv route.tmp man/pt_BR/route.8
|
|
||||||
#german
|
|
||||||
iconv -f iso-8859-1 -t utf-8 -o arp.tmp man/de_DE/arp.8 && mv arp.tmp man/de_DE/arp.8
|
|
||||||
iconv -f iso-8859-1 -t utf-8 -o ethers.tmp man/de_DE/ethers.5 && mv ethers.tmp man/de_DE/ethers.5
|
|
||||||
iconv -f iso-8859-1 -t utf-8 -o hostname.tmp man/de_DE/hostname.1 && mv hostname.tmp man/de_DE/hostname.1
|
|
||||||
iconv -f iso-8859-1 -t utf-8 -o ifconfig.tmp man/de_DE/ifconfig.8 && mv ifconfig.tmp man/de_DE/ifconfig.8
|
|
||||||
iconv -f iso-8859-1 -t utf-8 -o netstat.tmp man/de_DE/netstat.8 && mv netstat.tmp man/de_DE/netstat.8
|
|
||||||
iconv -f iso-8859-1 -t utf-8 -o plipconfig.tmp man/de_DE/plipconfig.8 && mv plipconfig.tmp man/de_DE/plipconfig.8
|
|
||||||
iconv -f iso-8859-1 -t utf-8 -o rarp.tmp man/de_DE/rarp.8 && mv rarp.tmp man/de_DE/rarp.8
|
|
||||||
iconv -f iso-8859-1 -t utf-8 -o route.tmp man/de_DE/route.8 && mv route.tmp man/de_DE/route.8
|
|
||||||
iconv -f iso-8859-1 -t utf-8 -o slattach.tmp man/de_DE/slattach.8 && mv slattach.tmp man/de_DE/slattach.8
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export CFLAGS="$RPM_OPT_FLAGS $CFLAGS"
|
export CFLAGS="$RPM_OPT_FLAGS $CFLAGS"
|
||||||
@ -222,6 +184,11 @@ fi
|
|||||||
%attr(0644,root,root) %{_unitdir}/arp-ethers.service
|
%attr(0644,root,root) %{_unitdir}/arp-ethers.service
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jan 11 2012 Jiri Popelka <jpopelka@redhat.com> - 1.60-132.20120111git
|
||||||
|
- 3 patches merged upstream
|
||||||
|
- removed 2digit.patch (#718610)
|
||||||
|
- removed fgets.patch (probably not needed anymore)
|
||||||
|
|
||||||
* Thu Jan 05 2012 Jiri Popelka <jpopelka@redhat.com> - 1.60-131.20120105git
|
* Thu Jan 05 2012 Jiri Popelka <jpopelka@redhat.com> - 1.60-131.20120105git
|
||||||
- next 11 patches merged upstream
|
- next 11 patches merged upstream
|
||||||
- removed bcast.patch (seems to be fixed upstream)
|
- removed bcast.patch (seems to be fixed upstream)
|
||||||
|
Loading…
Reference in New Issue
Block a user