diff --git a/SOURCES/net-tools-correct-exit-code.patch b/SOURCES/net-tools-correct-exit-code.patch new file mode 100644 index 0000000..b402343 --- /dev/null +++ b/SOURCES/net-tools-correct-exit-code.patch @@ -0,0 +1,605 @@ +diff --git a/netstat.c b/netstat.c +index 847c0dc..8dd2f29 100644 +--- a/netstat.c ++++ b/netstat.c +@@ -2061,7 +2061,7 @@ static void version(void) + } + + +-static void usage(void) ++static void usage(int rc) + { + fprintf(stderr, _("usage: netstat [-vWeenNcCF] [] -r netstat {-V|--version|-h|--help}\n")); + fprintf(stderr, _(" netstat [-vWnNcaeol] [ ...]\n")); +@@ -2100,7 +2100,7 @@ static void usage(void) + fprintf(stderr, _(" =Use '-6|-4' or '-A ' or '--'; default: %s\n"), DFLT_AF); + fprintf(stderr, _(" List of possible address families (which support routing):\n")); + print_aflist(1); /* 1 = routeable */ +- exit(E_USAGE); ++ exit(rc); + } + + +@@ -2292,20 +2292,21 @@ int main + + break; + case '?': ++ usage(E_OPTERR); + case 'h': +- usage(); ++ usage(E_USAGE); + case 's': + flag_sta++; + } + + if(argc == optind + 1) { + if((reptimer = atoi(argv[optind])) <= 0) +- usage(); ++ usage(E_OPTERR); + flag_cnt++; + } + + if (flag_int + flag_rou + flag_mas + flag_sta > 1) +- usage(); ++ usage(E_OPTERR); + + if ((flag_inet || flag_inet6 || flag_sta) && + !(flag_tcp || flag_sctp || flag_udp || flag_udplite || flag_raw)) +diff --git a/arp.c b/arp.c +index 5db71a7..30dd56d 100644 +--- a/arp.c ++++ b/arp.c +@@ -93,7 +93,7 @@ struct hwtype *hw; /* current hardware type */ + int sockfd = 0; /* active socket descriptor */ + int hw_set = 0; /* flag if hw-type was set (-H) */ + char device[16] = ""; /* current device */ +-static void usage(void); ++static void usage(int rc); + + /* Delete an entry from the ARP cache. */ + static int arp_del(char **args) +@@ -169,14 +169,14 @@ static int arp_del(char **args) + } + if (!strcmp(*args, "dev")) { + if (*++args == NULL) +- usage(); ++ usage(E_OPTERR); + safe_strncpy(device, *args, sizeof(device)); + args++; + continue; + } + if (!strcmp(*args, "netmask")) { + if (*++args == NULL) +- usage(); ++ usage(E_OPTERR); + if (strcmp(*args, "255.255.255.255") != 0) { + safe_strncpy(host, *args, (sizeof host)); + if (ap->input(0, host, sa) < 0) { +@@ -190,7 +190,7 @@ static int arp_del(char **args) + args++; + continue; + } +- usage(); ++ usage(E_OPTERR); + } + + // if neighter priv nor pub is given, work on both +@@ -346,14 +346,14 @@ static int arp_set(char **args) + } + if (!strcmp(*args, "dev")) { + if (*++args == NULL) +- usage(); ++ usage(E_OPTERR); + safe_strncpy(device, *args, sizeof(device)); + args++; + continue; + } + if (!strcmp(*args, "netmask")) { + if (*++args == NULL) +- usage(); ++ usage(E_OPTERR); + if (strcmp(*args, "255.255.255.255") != 0) { + safe_strncpy(host, *args, (sizeof host)); + if (ap->input(0, host, sa) < 0) { +@@ -367,7 +367,7 @@ static int arp_set(char **args) + args++; + continue; + } +- usage(); ++ usage(E_OPTERR); + } + + /* Fill in the remainder of the request. */ +@@ -621,7 +621,7 @@ static void version(void) + exit(E_VERSION); + } + +-static void usage(void) ++static void usage(int rc) + { + fprintf(stderr, _("Usage:\n arp [-vn] [] [-i ] [-a] [] <-Display ARP cache\n")); + fprintf(stderr, _(" arp [-v] [-i ] -d [pub] <-Delete ARP entry\n")); +@@ -643,7 +643,7 @@ static void usage(void) + fprintf(stderr, _(" =Use '-H ' to specify hardware address type. Default: %s\n"), DFLT_HW); + fprintf(stderr, _(" List of possible hardware types (which support ARP):\n")); + print_hwlist(1); /* 1 = ARPable */ +- exit(E_USAGE); ++ exit(rc); + } + + int main(int argc, char **argv) +@@ -745,10 +745,11 @@ int main(int argc, char **argv) + + case 'V': + version(); +- case '?': + case 'h': ++ usage(E_USAGE); ++ case '?': + default: +- usage(); ++ usage(E_OPTERR); + } + + if (ap->af != AF_INET) { +@@ -797,7 +798,7 @@ int main(int argc, char **argv) + break; + + default: +- usage(); ++ usage(E_OPTERR); + } + + exit(what); +diff --git a/ipmaddr.c b/ipmaddr.c +index e4ed41d..c45b62a 100644 +--- a/ipmaddr.c ++++ b/ipmaddr.c +@@ -53,14 +53,14 @@ static void version(void) + exit(E_VERSION); + } + +-static void usage(void) __attribute__((noreturn)); ++static void usage(int rc) __attribute__((noreturn)); + +-static void usage(void) ++static void usage(int rc) + { + fprintf(stderr, _("Usage: ipmaddr [ add | del ] MULTIADDR dev STRING\n")); + fprintf(stderr, _(" ipmaddr show [ dev STRING ] [ ipv4 | ipv6 | link | all ]\n")); + fprintf(stderr, _(" ipmaddr -V | -version\n")); +- exit(E_USAGE); ++ exit(rc); + } + + static void print_lla(FILE *fp, int len, unsigned char *addr) +@@ -294,7 +294,7 @@ static int multiaddr_list(int argc, char **argv) + NEXT_ARG(); + l = strlen(*argv); + if (l <= 0 || l >= sizeof(filter_dev)) +- usage(); ++ usage(E_OPTERR); + strncpy(filter_dev, *argv, sizeof (filter_dev)); + } else if (strcmp(*argv, "all") == 0) { + filter_family = AF_UNSPEC; +@@ -307,7 +307,7 @@ static int multiaddr_list(int argc, char **argv) + } else { + l = strlen(*argv); + if (l <= 0 || l >= sizeof(filter_dev)) +- usage(); ++ usage(E_OPTERR); + strncpy(filter_dev, *argv, sizeof (filter_dev)); + } + argv++; argc--; +@@ -339,18 +339,18 @@ int multiaddr_modify(int cmd, int argc, char **argv) + if (strcmp(*argv, "dev") == 0) { + NEXT_ARG(); + if (ifr.ifr_name[0]) +- usage(); ++ usage(E_OPTERR); + strncpy(ifr.ifr_name, *argv, IFNAMSIZ); + } else { + if (ifr.ifr_hwaddr.sa_data[0]) +- usage(); ++ usage(E_OPTERR); + if (parse_lla(*argv, ifr.ifr_hwaddr.sa_data) < 0) +- usage(); ++ usage(E_OPTERR); + } + argc--; argv++; + } + if (ifr.ifr_name[0] == 0) +- usage(); ++ usage(E_OPTERR); + + fd = socket(AF_INET, SOCK_DGRAM, 0); + if (fd < 0) { +@@ -378,7 +378,7 @@ int do_multiaddr(int argc, char **argv) + if (matches(*argv, "list") == 0 || matches(*argv, "show") == 0 + || matches(*argv, "lst") == 0) + return multiaddr_list(argc-1, argv+1); +- usage(); ++ usage(E_OPTERR); + } + + int preferred_family = AF_UNSPEC; +@@ -408,13 +408,13 @@ int main(int argc, char **argv) + argc--; + argv++; + if (argc <= 1) +- usage(); ++ usage(E_OPTERR); + if (strcmp(argv[1], "inet") == 0) + preferred_family = AF_INET; + else if (strcmp(argv[1], "inet6") == 0) + preferred_family = AF_INET6; + else +- usage(); ++ usage(E_OPTERR); + } else if (matches(argv[1], "-stats") == 0 || + matches(argv[1], "-statistics") == 0) { + ++show_stats; +@@ -423,7 +423,7 @@ int main(int argc, char **argv) + } else if ((matches(argv[1], "-V") == 0) || matches(argv[1], "--version") == 0) { + version(); + } else +- usage(); ++ usage(E_OPTERR); + argc--; argv++; + } + +diff --git a/include/util-ank.h b/include/util-ank.h +index c8fcd08..c78604a 100644 +--- a/include/util-ank.h ++++ b/include/util-ank.h +@@ -23,7 +23,7 @@ extern int resolve_hosts; + #define NEXT_ARG() \ + argv++; \ + if (--argc <= 0) \ +- usage(); ++ usage(E_OPTERR); + + typedef struct + { +diff --git a/iptunnel.c b/iptunnel.c +index 2215d68..42b2a9e 100644 +--- a/iptunnel.c ++++ b/iptunnel.c +@@ -76,9 +76,9 @@ static void version(void) + exit(E_VERSION); + } + +-static void usage(void) __attribute__((noreturn)); ++static void usage(int rc) __attribute__((noreturn)); + +-static void usage(void) ++static void usage(int rc) + { + fprintf(stderr, _("Usage: iptunnel { add | change | del | show } [ NAME ]\n")); + fprintf(stderr, _(" [ mode { ipip | gre | sit } ] [ remote ADDR ] [ local ADDR ]\n")); +@@ -90,7 +90,7 @@ static void usage(void) + fprintf(stderr, _(" TOS := { NUMBER | inherit }\n")); + fprintf(stderr, _(" TTL := { 1..255 | inherit }\n")); + fprintf(stderr, _(" KEY := { DOTTED_QUAD | NUMBER }\n")); +- exit(E_USAGE); ++ exit(rc); + } + + static int do_ioctl_get_ifindex(char *dev) +@@ -217,18 +217,18 @@ static int parse_args(int argc, char **argv, struct ip_tunnel_parm *p) + NEXT_ARG(); + if (strcmp(*argv, "ipip") == 0) { + if (p->iph.protocol) +- usage(); ++ usage(E_OPTERR); + p->iph.protocol = IPPROTO_IPIP; + } else if (strcmp(*argv, "gre") == 0) { + if (p->iph.protocol) +- usage(); ++ usage(E_OPTERR); + p->iph.protocol = IPPROTO_GRE; + } else if (strcmp(*argv, "sit") == 0) { + if (p->iph.protocol) +- usage(); ++ usage(E_OPTERR); + p->iph.protocol = IPPROTO_IPV6; + } else +- usage(); ++ usage(E_OPTERR); + } else if (strcmp(*argv, "key") == 0) { + unsigned uval; + NEXT_ARG(); +@@ -238,7 +238,7 @@ static int parse_args(int argc, char **argv, struct ip_tunnel_parm *p) + p->i_key = p->o_key = get_addr32(*argv); + else { + if (scan_number(*argv, &uval)<0) +- usage(); ++ usage(E_OPTERR); + p->i_key = p->o_key = htonl(uval); + } + } else if (strcmp(*argv, "ikey") == 0) { +@@ -249,7 +249,7 @@ static int parse_args(int argc, char **argv, struct ip_tunnel_parm *p) + p->o_key = get_addr32(*argv); + else { + if (scan_number(*argv, &uval)<0) +- usage(); ++ usage(E_OPTERR); + p->i_key = htonl(uval); + } + } else if (strcmp(*argv, "okey") == 0) { +@@ -260,7 +260,7 @@ static int parse_args(int argc, char **argv, struct ip_tunnel_parm *p) + p->o_key = get_addr32(*argv); + else { + if (scan_number(*argv, &uval)<0) +- usage(); ++ usage(E_OPTERR); + p->o_key = htonl(uval); + } + } else if (strcmp(*argv, "seq") == 0) { +@@ -295,9 +295,9 @@ static int parse_args(int argc, char **argv, struct ip_tunnel_parm *p) + NEXT_ARG(); + if (strcmp(*argv, "inherit") != 0) { + if (scan_number(*argv, &uval)<0) +- usage(); ++ usage(E_OPTERR); + if (uval > 255) +- usage(); ++ usage(E_OPTERR); + p->iph.ttl = uval; + } + } else if (strcmp(*argv, "tos") == 0) { +@@ -305,15 +305,15 @@ static int parse_args(int argc, char **argv, struct ip_tunnel_parm *p) + NEXT_ARG(); + if (strcmp(*argv, "inherit") != 0) { + if (scan_number(*argv, &uval)<0) +- usage(); ++ usage(E_OPTERR); + if (uval > 255) +- usage(); ++ usage(E_OPTERR); + p->iph.tos = uval; + } else + p->iph.tos = 1; + } else { + if (p->name[0]) +- usage(); ++ usage(E_OPTERR); + safe_strncpy(p->name, *argv, IFNAMSIZ); + } + argc--; argv++; +@@ -574,7 +574,7 @@ int do_iptunnel(int argc, char **argv) + } else + return do_show(0, NULL); + +- usage(); ++ usage(E_OPTERR); + } + + +@@ -605,13 +605,13 @@ int main(int argc, char **argv) + argc--; + argv++; + if (argc <= 1) +- usage(); ++ usage(E_OPTERR); + if (strcmp(argv[1], "inet") == 0) + preferred_family = AF_INET; + else if (strcmp(argv[1], "inet6") == 0) + preferred_family = AF_INET6; + else +- usage(); ++ usage(E_OPTERR); + } else if (matches(argv[1], "-stats") == 0 || + matches(argv[1], "-statistics") == 0) { + ++show_stats; +@@ -620,7 +620,7 @@ int main(int argc, char **argv) + } else if ((matches(argv[1], "-V") == 0) || (matches(argv[1], "--version") == 0)) { + version(); + } else +- usage(); ++ usage(E_OPTERR); + argc--; argv++; + } + +diff --git a/nameif.c b/nameif.c +index b280e59..13e3033 100644 +--- a/nameif.c ++++ b/nameif.c +@@ -192,10 +192,10 @@ struct option lopt[] = { + {NULL}, + }; + +-void usage(void) ++void usage(int rc) + { + fprintf(stderr, _("usage: nameif [-c configurationfile] [-s] {ifname macaddress}\n")); +- exit(E_USAGE); ++ exit(rc); + } + + int main(int ac, char **av) +@@ -214,7 +214,7 @@ int main(int ac, char **av) + switch (c) { + default: + case '?': +- usage(); ++ usage(E_OPTERR); + case 'c': + fname = optarg; + break; +@@ -232,7 +232,7 @@ int main(int ac, char **av) + char pos[30]; + + if ((ac-optind) & 1) +- usage(); ++ usage(E_OPTERR); + if (strlen(av[optind])+1>IFNAMSIZ) + complain(_("interface name `%s' too long"), av[optind]); + safe_strncpy(ch->ifname, av[optind], sizeof(ch->ifname)); +diff --git a/plipconfig.c b/plipconfig.c +index 86fa890..1caeed3 100644 +--- a/plipconfig.c ++++ b/plipconfig.c +@@ -57,12 +57,12 @@ static void version(void) + exit(E_VERSION); + } + +-void usage(void) ++void usage(int rc) + { + fprintf(stderr, _("Usage: plipconfig interface [nibble NN] [trigger NN]\n")); + fprintf(stderr, _(" plipconfig -V | --version\n")); + fprintf(stderr, _(" plipconfig -h | --help\n")); +- exit(E_USAGE); ++ exit(rc); + } + + void print_plip(void) +@@ -89,16 +89,18 @@ int main(int argc, char **argv) + argc--; + argv++; + while (argv[0] && *argv[0] == '-') { +- if (!strcmp(*argv, "-V") || !strcmp(*argv, "--version")) ++ if ((!strcmp(*argv, "-V") || !strcmp(*argv, "--version")) && argc==1) + version(); ++ if ((!strcmp(*argv, "-h") || !strcmp(*argv, "--help")) && argc==1) ++ usage(E_USAGE); + else +- usage(); ++ usage(E_OPTERR); + argv++; + argc--; + } + + if (argc == 0) +- usage(); ++ usage(E_OPTERR); + + spp = argv; + safe_strncpy(ifr.ifr_name, *spp++, IFNAMSIZ); +@@ -117,19 +119,19 @@ int main(int argc, char **argv) + while (*spp != (char *) NULL) { + if (!strcmp(*spp, "nibble")) { + if (*++spp == NULL) +- usage(); ++ usage(E_OPTERR); + plip->nibble = atoi(*spp); + spp++; + continue; + } + if (!strcmp(*spp, "trigger")) { + if (*++spp == NULL) +- usage(); ++ usage(E_OPTERR); + plip->trigger = atoi(*spp); + spp++; + continue; + } +- usage(); ++ usage(E_OPTERR); + } + + plip->pcmd = PLIP_SET_TIMEOUT; +diff --git a/route.c b/route.c +index 4eaed49..d5a3039 100644 +--- a/route.c ++++ b/route.c +@@ -76,7 +76,7 @@ int opt_fc = 0; // routing cache/FIB + int opt_h = 0; // help selected + struct aftype *ap; // selected address family + +-static void usage(void) ++static void usage(int rc) + { + fprintf(stderr, _("Usage: route [-nNvee] [-FC] [] List kernel routing tables\n")); + fprintf(stderr, _(" route [-v] [-FC] {add|del|flush} ... Modify routing table for AF.\n\n")); +@@ -93,7 +93,7 @@ static void usage(void) + fprintf(stderr, _(" =Use -4, -6, '-A ' or '--'; default: %s\n"), DFLT_AF); + fprintf(stderr, _(" List of possible address families (which support routing):\n")); + print_aflist(1); /* 1 = routeable */ +- exit(E_USAGE); ++ exit(rc); + } + + +@@ -186,11 +186,12 @@ int main(int argc, char **argv) + case 'V': + version(); + case 'h': ++ usage(E_USAGE); + case '?': + opt_h++; + break; + default: +- usage(); ++ usage(E_OPTERR); + } + + argv += optind; +@@ -198,7 +199,7 @@ int main(int argc, char **argv) + + if (opt_h) { + if (!afname[0]) +- usage(); ++ usage(E_OPTERR); + else + what = RTACTION_HELP; + } else { +@@ -217,7 +218,7 @@ int main(int argc, char **argv) + else if (!strcmp(*argv, "flush")) + what = RTACTION_FLUSH; + else +- usage(); ++ usage(E_OPTERR); + } + } + +@@ -231,7 +232,7 @@ int main(int argc, char **argv) + i = route_edit(what, afname, options, ++argv); + + if (i == E_OPTERR) +- usage(); ++ usage(E_OPTERR); + + return (i); + } +diff --git a/slattach.c b/slattach.c +index 5c81584..dbb2658 100644 +--- a/slattach.c ++++ b/slattach.c +@@ -581,7 +581,7 @@ sig_catch(int sig) + + + static void +-usage(void) ++usage(int rc) + { + char *usage_msg = "Usage: slattach [-ehlLmnqv] " + #ifdef SIOCSKEEPALIVE +@@ -594,7 +594,7 @@ usage(void) + " slattach -V | --version\n"; + + fputs(usage_msg, stderr); +- exit(E_USAGE); ++ exit(rc); + } + + +@@ -691,7 +691,7 @@ main(int argc, char *argv[]) + /*NOTREACHED*/ + + default: +- usage(); ++ usage(E_OPTERR); + /*NOTREACHED*/ + } + +@@ -707,7 +707,7 @@ main(int argc, char *argv[]) + opt_m++; + + /* Is a terminal given? */ +- if (optind != (argc - 1)) usage(); ++ if (optind != (argc - 1)) usage(E_OPTERR); + safe_strncpy(path_buf, argv[optind], sizeof(path_buf)); + if (!strcmp(path_buf, "-")) { + opt_e = 1; diff --git a/SOURCES/net-tools-ifconfig-EiB.patch b/SOURCES/net-tools-ifconfig-EiB.patch new file mode 100644 index 0000000..7bcba0b --- /dev/null +++ b/SOURCES/net-tools-ifconfig-EiB.patch @@ -0,0 +1,28 @@ +diff --git a/lib/interface.c.old b/lib/interface.c +index 13017ae..3bd999f 100644 +--- a/lib/interface.c.old ++++ b/lib/interface.c +@@ -927,7 +927,10 @@ void ife_print_long(struct interface *ptr) + */ + rx = ptr->stats.rx_bytes; + short_rx = rx * 10; +- if (rx > 1125899906842624ull) { ++ if (rx > 1152921504606846976ull) { ++ short_rx = rx / 115292150460684697ull; ++ Rext = "EiB"; ++ } else if (rx > 1125899906842624ull) { + short_rx /= 1125899906842624ull; + Rext = "PiB"; + } else if (rx > 1099511627776ull) { +@@ -945,7 +948,10 @@ void ife_print_long(struct interface *ptr) + } + tx = ptr->stats.tx_bytes; + short_tx = tx * 10; +- if (tx > 1125899906842624ull) { ++ if (tx > 1152921504606846976ull) { ++ short_tx = tx / 115292150460684697ull; ++ Text = "EiB"; ++ } else if (tx > 1125899906842624ull) { + short_tx /= 1125899906842624ull; + Text = "PiB"; + } else if (tx > 1099511627776ull) { diff --git a/SOURCES/net-tools-netstat-sctp-man.patch b/SOURCES/net-tools-netstat-sctp-man.patch new file mode 100644 index 0000000..f9600ad --- /dev/null +++ b/SOURCES/net-tools-netstat-sctp-man.patch @@ -0,0 +1,74 @@ +diff --git a/man/de_DE/netstat.8 b/man/de_DE/netstat.8 +index d6b77ff..fdb76c9 100644 +--- a/man/de_DE/netstat.8 ++++ b/man/de_DE/netstat.8 +@@ -20,6 +20,8 @@ netstat \- Anzeige von Netzwerksverbindungen, Routentabellen, Schnittstellenstat + .RB [ \-venaoc ] + .RB [ \-\-tcp | \-t ] + .RB [ \-\-udp | \-u ] ++.RB [ \-\-udplite | \-U ] ++.RB [ \-\-sctp | \-S ] + .RB [ \-\-raw | \-w ] + .RB [ \-\-groups | \-g ] + .RB [ \-\-unix | \-x ] +diff --git a/man/en_US/netstat.8 b/man/en_US/netstat.8 +index 831faf2..7fcd41b 100644 +--- a/man/en_US/netstat.8 ++++ b/man/en_US/netstat.8 +@@ -21,6 +21,7 @@ netstat \- Print network connections, routing tables, interface statistics, masq + .RB [ \-\-tcp | \-t ] + .RB [ \-\-udp | \-u ] + .RB [ \-\-udplite | \-U ] ++.RB [ \-\-sctp | \-S ] + .RB [ \-\-raw | \-w ] + .RB [ \-\-listening | \-l ] + .RB [ \-\-all | \-a ] +@@ -76,6 +77,7 @@ netstat \- Print network connections, routing tables, interface statistics, masq + .RB [ \-\-tcp | \-t ] + .RB [ \-\-udp | \-u ] + .RB [ \-\-udplite | \-U ] ++.RB [ \-\-sctp | \-S ] + .RB [ \-\-raw | \-w ] + .RB [delay] + .P +diff --git a/man/fr_FR/netstat.8 b/man/fr_FR/netstat.8 +index fedbe4f..c65d0be 100644 +--- a/man/fr_FR/netstat.8 ++++ b/man/fr_FR/netstat.8 +@@ -21,6 +21,8 @@ et les membres multicast. + .RB [ \-venaoc ] + .RB [ \-\-tcp | \-t ] + .RB [ \-\-udp | \-u ] ++.RB [ \-\-udplite | \-U ] ++.RB [ \-\-sctp | \-S ] + .RB [ \-\-raw | \-w ] + .RB [ \-\-groups | \-g ] + .RB [ \-\-unix | \-x ] +diff --git a/man/pt_BR/netstat.8 b/man/pt_BR/netstat.8 +index 1903bbb..d2d04ef 100644 +--- a/man/pt_BR/netstat.8 ++++ b/man/pt_BR/netstat.8 +@@ -19,6 +19,8 @@ mascaradas. + .RB [ \-venaoc ] + .RB [ \-\-tcp | \-t ] + .RB [ \-\-udp | \-u ] ++.RB [ \-\-udplite | \-U ] ++.RB [ \-\-sctp | \-S ] + .RB [ \-\-raw | \-w ] + .RB [ \-\-unix | \-x ] + .RB [ \-\-inet | \-\-ip ] +diff --git a/netstat.c b/netstat.c +index 43bd62f..ca93260 100644 +--- a/netstat.c ++++ b/netstat.c +@@ -2094,8 +2095,8 @@ static void usage(void) + fprintf(stderr, _(" -Z, --context display SELinux security context for sockets\n")); + #endif + +- fprintf(stderr, _("\n ={-t|--tcp} {-u|--udp} {-U|--udplite} {-w|--raw} {-x|--unix}\n")); +- fprintf(stderr, _(" --ax25 --ipx --netrom\n")); ++ fprintf(stderr, _("\n ={-t|--tcp} {-u|--udp} {-U|--udplite} {-S|--sctp} {-w|--raw}\n")); ++ fprintf(stderr, _(" {-x|--unix} --ax25 --ipx --netrom\n")); + fprintf(stderr, _(" =Use '-6|-4' or '-A ' or '--'; default: %s\n"), DFLT_AF); + fprintf(stderr, _(" List of possible address families (which support routing):\n")); + print_aflist(1); /* 1 = routeable */ diff --git a/SOURCES/net-tools-sctp-statistics.patch b/SOURCES/net-tools-sctp-statistics.patch index d0ffd2d..b84b8aa 100644 --- a/SOURCES/net-tools-sctp-statistics.patch +++ b/SOURCES/net-tools-sctp-statistics.patch @@ -10,7 +10,7 @@ diff -up net-tools-2.0/netstat.c.sctp net-tools-2.0/netstat.c void inittab(void); int parsesnmp6(int, int, int); void inittab6(void); -@@ -888,161 +888,271 @@ static int igmp_info(void) +@@ -888,159 +888,269 @@ static int igmp_info(void) igmp_do_one, "igmp", "igmp6"); } @@ -409,19 +409,13 @@ diff -up net-tools-2.0/netstat.c.sctp net-tools-2.0/netstat.c + sctp_assoc_do_one, "sctp", "sctp6"); } --static int sctp_info(void) { -- int res; + static int sctp_info(void) { + int res; - res = sctp_info_epts(); -- if(res) return res; -- return sctp_info_assocs(); -+static int sctp_info(void) -+{ -+ if(flag_all) -+ sctp_info_eps(); -+ return sctp_info_assocs(); ++ res = sctp_info_eps(); + if(res) return res; + return sctp_info_assocs(); } - - static void addr_do_one(char *buf, size_t buf_len, size_t short_len, struct aftype *ap, @@ -2234,7 +2344,7 @@ int main if (!strcmp(afname, "inet")) { #if HAVE_AFINET diff --git a/SPECS/net-tools.spec b/SPECS/net-tools.spec index a469ad9..2ee770e 100644 --- a/SPECS/net-tools.spec +++ b/SPECS/net-tools.spec @@ -3,7 +3,7 @@ Summary: Basic networking tools Name: net-tools Version: 2.0 -Release: 0.17.%{checkout}%{?dist} +Release: 0.22.%{checkout}%{?dist} License: GPLv2+ Group: System Environment/Base URL: http://sourceforge.net/projects/net-tools/ @@ -56,6 +56,15 @@ Patch20: ether-wake-interfaces.patch # make sctp quiet on systems without sctp (#1063906) Patch21: net-tools-sctp-quiet.patch +# make net-tools exit with correct exit code when provided with wrong parameters +Patch22: net-tools-correct-exit-code.patch + +# make ifconfig accurately round exabytes +Patch23: net-tools-ifconfig-EiB.patch + +# sctp was not documented in help and manpage +Patch24: net-tools-netstat-sctp-man.patch + BuildRequires: gettext, libselinux BuildRequires: libselinux-devel BuildRequires: systemd-units @@ -90,6 +99,9 @@ cp %SOURCE8 ./man/en_US %patch20 -p1 -b .interfaces %patch21 -p1 -b .sctp-quiet +%patch22 -p1 -b .exit-code +%patch23 -p1 -b .round-EiB +%patch24 -p1 -b .sctp-man touch ./config.h @@ -166,6 +178,23 @@ install -m 644 %{SOURCE9} %{buildroot}%{_unitdir} %attr(0644,root,root) %{_unitdir}/arp-ethers.service %changelog +* Wed Mar 29 2017 Michal Ruprich - 2.0-0.22.20131004git +- Resolves: #1167833 - netstat -S/--sctp not documented + +* Wed Mar 22 2017 Michal Ruprich - 2.0-0.21.20131004git +- Related: #1427889 - exit code on wrong parameter is zero for many net-tools binaries + +* Wed Mar 22 2017 Michal Ruprich - 2.0-0.20.20131004git +- Resolves: #1427889 - exit code on wrong parameter is zero for many net-tools binaries + +* Mon Feb 27 2017 Michal Ruprich - 2.0-0.19.20131004git +- Related: #1257549 - netstat tool does not throw correct exit code on wrong parameter + +* Wed Jan 18 2017 Michal Ruprich - 2.0-0.18.20131004git +- Resolves: #1063913 - netstat doesn't list sctp servers in -A mode +- Resolves: #1257549 - netstat tool does not throw correct exit code on wrong parameter +- Resolves: #1392910 - ifconfig inaccurately rounds exabytes + * Fri Feb 14 2014 Jaromír Končický - 2.0-0.17.20131004git - remake sctp-quiet.patch (#1063906#c7)