1 diff -urNp -x '*.orig' net-tools-2.10.org/man/en_US/netstat.8 net-tools-2.10/man/en_US/netstat.8
2 --- net-tools-2.10.org/man/en_US/netstat.8 2021-01-07 00:22:35.000000000 +0100
3 +++ net-tools-2.10/man/en_US/netstat.8 2023-12-02 23:35:08.827986462 +0100
4 @@ -47,9 +47,9 @@ netstat \- Print network connections, ro
5 .RB [ \-\-continuous | \-c ]
8 -.RB { \-\-interfaces | \-i }
9 +.RB { \-\-interfaces | \-I | \-i }
11 -.RB [ \-\-extend | \-e [ \-\-extend | \-e] ]
12 +.RB [ \-\-extend | \-e ]
13 .RB [ \-\-verbose | \-v ]
14 .RB [ \-\-program | \-p ]
15 .RB [ \-\-numeric | \-n ]
16 @@ -128,8 +128,8 @@ and
17 produce the same output.
19 Display multicast group membership information for IPv4 and IPv6.
20 -.SS "\-\-interfaces, \-i"
21 -Display a table of all network interfaces.
22 +.SS "\-\-interfaces=\fIiface \fR, \fB\-I=\fIiface \fR, \fB\-i"
23 +Display a table of all network interfaces, or the specified \fIiface\fR.
24 .SS "\-\-masquerade, \-M"
25 Display a list of masqueraded connections.
26 .SS "\-\-statistics, \-s"
27 diff -urNp -x '*.orig' net-tools-2.10.org/netstat.c net-tools-2.10/netstat.c
28 --- net-tools-2.10.org/netstat.c 2023-12-02 23:35:08.762985691 +0100
29 +++ net-tools-2.10/netstat.c 2023-12-02 23:35:08.827986462 +0100
30 @@ -149,6 +149,7 @@ static char *Release = RELEASE, *Signatu
34 +char *flag_int_name = NULL;
38 @@ -2132,6 +2133,7 @@ static int rfcomm_info(void)
40 static int iface_info(void)
42 + struct interface *ife = NULL;
44 if ((skfd = sockets_open(0)) < 0) {
46 @@ -2144,7 +2146,11 @@ static int iface_info(void)
47 printf(_("Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
50 - if (for_all_interfaces(do_if_print, &flag_all) < 0) {
51 + if (flag_int_name) {
52 + ife = lookup_interface(flag_int_name);
53 + do_if_print(ife, &flag_all);
55 + else if (for_all_interfaces(do_if_print, &flag_all) < 0) {
56 perror(_("missing interface information"));
59 @@ -2171,10 +2177,11 @@ static void usage(int rc)
60 FILE *fp = rc ? stderr : stdout;
61 fprintf(fp, _("usage: netstat [-vWeenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}\n"));
62 fprintf(fp, _(" netstat [-vWnNcaeol] [<Socket> ...]\n"));
63 - fprintf(fp, _(" netstat { [-vWeenNac] -i | [-cnNe] -M | -s [-6tuw] }\n\n"));
64 + fprintf(fp, _(" netstat { [-vWeenNac] -I[<Iface>] | -i | [-cnNe] -M | -s [-6tuw] }\n\n"));
66 fprintf(fp, _(" -r, --route display routing table\n"));
67 fprintf(fp, _(" -i, --interfaces display interface table\n"));
68 + fprintf(fp, _(" -I, --interfaces=<Iface> display interface table for <Iface>\n"));
69 fprintf(fp, _(" -g, --groups display multicast group memberships\n"));
70 fprintf(fp, _(" -s, --statistics display networking statistics (like SNMP)\n"));
71 #if HAVE_FW_MASQUERADE
72 @@ -2217,7 +2224,7 @@ int main
75 {"version", 0, 0, 'V'},
76 - {"interfaces", 0, 0, 'i'},
77 + {"interfaces", 2, 0, 'I'},
80 #if HAVE_FW_MASQUERADE
81 @@ -2261,7 +2268,7 @@ int main
82 getroute_init(); /* Set up AF routing support */
85 - while ((i = getopt_long(argc, argv, "A:CFMacdeghilnNoprsStuUvVWw2fx64?Z", longopts, &lop)) != EOF)
86 + while ((i = getopt_long(argc, argv, "A:CFMacdeghiI::lnNoprsStuUvVWw2fx64?Z", longopts, &lop)) != EOF)
90 @@ -2302,6 +2309,13 @@ int main
95 + if (optarg && strcmp(optarg, "(null)"))
96 + if (optarg[0] == '=') optarg++;
97 + if (optarg && strcmp(optarg, "(null)"))
98 + flag_int_name = strdup(optarg);