5db53aaa527f4a3e40bfb771d914026a8a5e4709
[openwrt/openwrt.git] / package / network / utils / iftop / patches / 110-fix-mac-display.patch
1 iftop: fix mac address display
2
3 iftop would display portions of mac address with large ffffff prefixes.
4 Make if_hw_addr type consistent.
5
6 Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
7 ---
8 addrs_dlpi.c | 2 +-
9 addrs_ioctl.c | 2 +-
10 addrs_ioctl.h | 2 +-
11 iftop.c | 2 +-
12 4 files changed, 4 insertions(+), 4 deletions(-)
13
14 diff --git a/addrs_dlpi.c b/addrs_dlpi.c
15 index 188fef8..6c04ea1 100644
16 --- a/addrs_dlpi.c
17 +++ b/addrs_dlpi.c
18 @@ -50,7 +50,7 @@ extern char *strncat2(char *dest, char *src, int n);
19 */
20
21 int
22 -get_addrs_dlpi(char *interface, char if_hw_addr[], struct in_addr *if_ip_addr)
23 +get_addrs_dlpi(char *interface, u_int8_t if_hw_addr[], struct in_addr *if_ip_addr)
24 {
25 int got_hw_addr = 0;
26 int got_ip_addr = 0;
27 diff --git a/addrs_ioctl.c b/addrs_ioctl.c
28 index 870c83b..7d01fb2 100644
29 --- a/addrs_ioctl.c
30 +++ b/addrs_ioctl.c
31 @@ -45,7 +45,7 @@
32 */
33
34 int
35 -get_addrs_ioctl(char *interface, char if_hw_addr[], struct in_addr *if_ip_addr, struct in6_addr *if_ip6_addr)
36 +get_addrs_ioctl(char *interface, u_int8_t if_hw_addr[], struct in_addr *if_ip_addr, struct in6_addr *if_ip6_addr)
37 {
38 int s;
39 struct ifreq ifr = {};
40 diff --git a/addrs_ioctl.h b/addrs_ioctl.h
41 index f93a0b4..739de61 100644
42 --- a/addrs_ioctl.h
43 +++ b/addrs_ioctl.h
44 @@ -7,6 +7,6 @@
45 #define __ADDRS_IOCTL_H_
46
47 int
48 -get_addrs_ioctl(char *interface, char if_hw_addr[], struct in_addr *if_ip_addr, struct in6_addr *if_ip6_addr);
49 +get_addrs_ioctl(char *interface, u_int8_t if_hw_addr[], struct in_addr *if_ip_addr, struct in6_addr *if_ip6_addr);
50
51 #endif /* __ADDRS_IOCTL_H_ */
52 diff --git a/iftop.c b/iftop.c
53 index a090dcf..f1b371a 100644
54 --- a/iftop.c
55 +++ b/iftop.c
56 @@ -55,7 +55,7 @@
57
58 /* ethernet address of interface. */
59 int have_hw_addr = 0;
60 -char if_hw_addr[6];
61 +u_int8_t if_hw_addr[6];
62
63 /* IP address of interface */
64 int have_ip_addr = 0;
65 --
66 1.9.1
67