netplug-1.2.9-ignore-wireless.patch 938 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --- netplug-1.2.9/main.c
  2. +++ netplug-1.2.9/main.c
  3. @@ -36,6 +36,10 @@
  4. #include "netplug.h"
  5. +/* Support old kernels without wireless */
  6. +#ifndef IFLA_WIRELESS
  7. +#define IFLA_WIRELESS (IFLA_MASTER + 1)
  8. +#endif /* IFLA_WIRELESS */
  9. int use_syslog;
  10. static char *pid_file;
  11. @@ -63,6 +67,14 @@
  12. parse_rtattrs(attrs, IFLA_MAX, IFLA_RTA(info), len);
  13. + /* Ignore wireless messages */
  14. + if (attrs[IFLA_WIRELESS] != NULL
  15. + && hdr->nlmsg_type == RTM_NEWLINK
  16. + && info->ifi_change == 0) {
  17. + do_log(LOG_DEBUG, "Ignoring wireless netlink message");
  18. + return 0;
  19. + }
  20. +
  21. if (attrs[IFLA_IFNAME] == NULL) {
  22. do_log(LOG_ERR, "No interface name");
  23. return -1;
  24. @@ -71,7 +83,7 @@
  25. char *name = RTA_DATA(attrs[IFLA_IFNAME]);
  26. if (!if_match(name)) {
  27. - do_log(LOG_INFO, "%s: ignoring event", name);
  28. + do_log(LOG_DEBUG, "%s: ignoring event", name);
  29. return 0;
  30. }