diff options
Diffstat (limited to 'src/firemon/interface.c')
-rw-r--r-- | src/firemon/interface.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/firemon/interface.c b/src/firemon/interface.c index 77dd1f277..44374ed60 100644 --- a/src/firemon/interface.c +++ b/src/firemon/interface.c | |||
@@ -64,13 +64,13 @@ static void net_ifprint(void) { | |||
64 | memset(&ifr, 0, sizeof(ifr)); | 64 | memset(&ifr, 0, sizeof(ifr)); |
65 | strncpy(ifr.ifr_name, ifa->ifa_name, IFNAMSIZ); | 65 | strncpy(ifr.ifr_name, ifa->ifa_name, IFNAMSIZ); |
66 | int rv = ioctl (fd, SIOCGIFHWADDR, &ifr); | 66 | int rv = ioctl (fd, SIOCGIFHWADDR, &ifr); |
67 | 67 | ||
68 | if (rv == 0) | 68 | if (rv == 0) |
69 | printf(" %s UP, %02x:%02x:%02x:%02x:%02x:%02x\n", | 69 | printf(" %s UP, %02x:%02x:%02x:%02x:%02x:%02x\n", |
70 | ifa->ifa_name, PRINT_MAC((unsigned char *) &ifr.ifr_hwaddr.sa_data)); | 70 | ifa->ifa_name, PRINT_MAC((unsigned char *) &ifr.ifr_hwaddr.sa_data)); |
71 | else | 71 | else |
72 | printf(" %s UP\n", ifa->ifa_name); | 72 | printf(" %s UP\n", ifa->ifa_name); |
73 | 73 | ||
74 | printf(" tx/rx: %u/%u packets, %u/%u bytes\n", | 74 | printf(" tx/rx: %u/%u packets, %u/%u bytes\n", |
75 | stats->tx_packets, stats->rx_packets, | 75 | stats->tx_packets, stats->rx_packets, |
76 | stats->tx_bytes, stats->rx_bytes); | 76 | stats->tx_bytes, stats->rx_bytes); |
@@ -78,7 +78,7 @@ static void net_ifprint(void) { | |||
78 | } | 78 | } |
79 | else | 79 | else |
80 | printf(" %s DOWN\n", ifa->ifa_name); | 80 | printf(" %s DOWN\n", ifa->ifa_name); |
81 | } | 81 | } |
82 | } | 82 | } |
83 | 83 | ||
84 | 84 | ||
@@ -139,7 +139,7 @@ static void print_sandbox(pid_t pid) { | |||
139 | pid_t child = fork(); | 139 | pid_t child = fork(); |
140 | if (child == -1) | 140 | if (child == -1) |
141 | return; | 141 | return; |
142 | 142 | ||
143 | if (child == 0) { | 143 | if (child == 0) { |
144 | int rv = join_namespace(pid, "net"); | 144 | int rv = join_namespace(pid, "net"); |
145 | if (rv) | 145 | if (rv) |
@@ -150,14 +150,14 @@ static void print_sandbox(pid_t pid) { | |||
150 | #endif | 150 | #endif |
151 | _exit(0); | 151 | _exit(0); |
152 | } | 152 | } |
153 | 153 | ||
154 | // wait for the child to finish | 154 | // wait for the child to finish |
155 | waitpid(child, NULL, 0); | 155 | waitpid(child, NULL, 0); |
156 | } | 156 | } |
157 | 157 | ||
158 | void interface(pid_t pid, int print_procs) { | 158 | void interface(pid_t pid, int print_procs) { |
159 | pid_read(pid); // a pid of 0 will include all processes | 159 | pid_read(pid); // a pid of 0 will include all processes |
160 | 160 | ||
161 | // print processes | 161 | // print processes |
162 | int i; | 162 | int i; |
163 | for (i = 0; i < max_pids; i++) { | 163 | for (i = 0; i < max_pids; i++) { |
@@ -172,4 +172,3 @@ void interface(pid_t pid, int print_procs) { | |||
172 | } | 172 | } |
173 | printf("\n"); | 173 | printf("\n"); |
174 | } | 174 | } |
175 | |||