110-fix-mac-display.patch 1.8 KB

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