diff options
-rw-r--r-- | src/fnet/interface.c | 17 | ||||
-rwxr-xr-x | test/network/netstats.exp | 13 | ||||
-rwxr-xr-x | test/network/network.sh | 5 |
3 files changed, 25 insertions, 10 deletions
diff --git a/src/fnet/interface.c b/src/fnet/interface.c index ca7c744ed..50e1beaa0 100644 --- a/src/fnet/interface.c +++ b/src/fnet/interface.c | |||
@@ -213,6 +213,23 @@ void net_ifprint(int scan) { | |||
213 | fmessage("%-17.17s%-19.19s%-17.17s%-17.17s%-6.6s\n", | 213 | fmessage("%-17.17s%-19.19s%-17.17s%-17.17s%-6.6s\n", |
214 | ifa->ifa_name, macstr, ipstr, maskstr, status); | 214 | ifa->ifa_name, macstr, ipstr, maskstr, status); |
215 | 215 | ||
216 | // print ipv6 address | ||
217 | if (!scan) { | ||
218 | struct ifaddrs *ptr = ifa->ifa_next; | ||
219 | while (ptr) { | ||
220 | if (ptr->ifa_addr->sa_family == AF_INET6 && strcmp(ifa->ifa_name, ptr->ifa_name) == 0) { | ||
221 | struct sockaddr_in6 *s6 = (struct sockaddr_in6 *)ptr->ifa_addr; | ||
222 | struct in6_addr *in_addr = &s6->sin6_addr; | ||
223 | char buf[64]; | ||
224 | if(inet_ntop(ptr->ifa_addr->sa_family, in_addr, buf, sizeof(buf))) { | ||
225 | fmessage("%-35.35s %s\n", " ", buf); | ||
226 | break; | ||
227 | } | ||
228 | } | ||
229 | ptr = ptr->ifa_next; | ||
230 | } | ||
231 | } | ||
232 | |||
216 | // network scanning | 233 | // network scanning |
217 | if (!scan) // scanning disabled | 234 | if (!scan) // scanning disabled |
218 | continue; | 235 | continue; |
diff --git a/test/network/netstats.exp b/test/network/netstats.exp index a8b28bed8..0d1bc4c2c 100755 --- a/test/network/netstats.exp +++ b/test/network/netstats.exp | |||
@@ -20,12 +20,11 @@ expect { | |||
20 | timeout {puts "TESTING ERROR 2\n";exit} | 20 | timeout {puts "TESTING ERROR 2\n";exit} |
21 | "statistics only for sandboxes using a new network namespace" | 21 | "statistics only for sandboxes using a new network namespace" |
22 | } | 22 | } |
23 | # not supported on github workflows - not a tty! | 23 | sleep 4 |
24 | #expect { | 24 | |
25 | # timeout {puts "TESTING ERROR 3\n";exit} | 25 | expect { |
26 | # "firejail --name=test --net=br0" | 26 | timeout {puts "TESTING ERROR 3\n";exit} |
27 | #} | 27 | "firejail --name=test --net=br0" |
28 | #after 500 | 28 | } |
29 | #send -- "\r" | ||
30 | after 500 | 29 | after 500 |
31 | puts "\nall done\n" | 30 | puts "\nall done\n" |
diff --git a/test/network/network.sh b/test/network/network.sh index 5e320cc2f..dad1ed42d 100755 --- a/test/network/network.sh +++ b/test/network/network.sh | |||
@@ -42,9 +42,8 @@ echo "TESTING: ipv6 (ip6.exp)" | |||
42 | echo "TESTING: ipv6 netfilter (ip6_netfilter.exp)" | 42 | echo "TESTING: ipv6 netfilter (ip6_netfilter.exp)" |
43 | ./ip6_netfilter.exp | 43 | ./ip6_netfilter.exp |
44 | 44 | ||
45 | # not supported on github workflows - not a tty! | 45 | echo "TESTING: netstats (netstats.exp)" |
46 | #echo "TESTING: netstats (netstats.exp)" | 46 | ./netstats.exp |
47 | #./netstats.exp | ||
48 | 47 | ||
49 | echo "TESTING: firemon arp (firemon-arp.exp)" | 48 | echo "TESTING: firemon arp (firemon-arp.exp)" |
50 | ./firemon-arp.exp | 49 | ./firemon-arp.exp |