patch-agent_mibgroup_mibII_tcpTable_c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. --- net-snmp-5.7.2.orig/agent/mibgroup/mibII/tcpTable.c 2012-10-10 00:28:58.000000000 +0200
  2. +++ net-snmp-5.7.2/agent/mibgroup/mibII/tcpTable.c 2014-01-01 17:12:30.000000000 +0100
  3. @@ -34,6 +34,12 @@
  4. #include <netlink/netlink.h>
  5. #include <netlink/msg.h>
  6. #include <linux/inet_diag.h>
  7. +
  8. +/* libnl 2.0 compatibility code */
  9. +#define nl_handle nl_sock
  10. +#define nl_handle_alloc nl_socket_alloc
  11. +#define nl_handle_alloc_cb nl_socket_alloc_cb
  12. +#define nl_handle_destroy nl_socket_free
  13. #endif
  14. #include <net-snmp/net-snmp-includes.h>
  15. @@ -579,8 +585,8 @@ tcpTable_load_netlink(void)
  16. }
  17. if (nl_connect(nl, NETLINK_INET_DIAG) < 0) {
  18. - DEBUGMSGTL(("mibII/tcpTable", "Failed to connect to netlink: %s\n", nl_geterror()));
  19. - snmp_log(LOG_ERR, "snmpd: Couldn't connect to netlink: %s\n", nl_geterror());
  20. + DEBUGMSGTL(("mibII/tcpTable", "Failed to connect to netlink: %s\n", nl_geterror(1)));
  21. + snmp_log(LOG_ERR, "snmpd: Couldn't connect to netlink: %s\n", nl_geterror(1));
  22. nl_handle_destroy(nl);
  23. return -1;
  24. }
  25. @@ -594,8 +600,8 @@ tcpTable_load_netlink(void)
  26. nlmsg_append(nm, &req, sizeof(struct inet_diag_req), 0);
  27. if (nl_send_auto_complete(nl, nm) < 0) {
  28. - DEBUGMSGTL(("mibII/tcpTable", "nl_send_autocomplete(): %s\n", nl_geterror()));
  29. - snmp_log(LOG_ERR, "snmpd: nl_send_autocomplete(): %s\n", nl_geterror());
  30. + DEBUGMSGTL(("mibII/tcpTable", "nl_send_autocomplete(): %s\n", nl_geterror(1)));
  31. + snmp_log(LOG_ERR, "snmpd: nl_send_autocomplete(): %s\n", nl_geterror(1));
  32. nl_handle_destroy(nl);
  33. return -1;
  34. }
  35. @@ -607,8 +613,8 @@ tcpTable_load_netlink(void)
  36. while (running) {
  37. if ((len = nl_recv(nl, &peer, &buf, NULL)) <= 0) {
  38. - DEBUGMSGTL(("mibII/tcpTable", "nl_recv(): %s\n", nl_geterror()));
  39. - snmp_log(LOG_ERR, "snmpd: nl_recv(): %s\n", nl_geterror());
  40. + DEBUGMSGTL(("mibII/tcpTable", "nl_recv(): %s\n", nl_geterror(1)));
  41. + snmp_log(LOG_ERR, "snmpd: nl_recv(): %s\n", nl_geterror(1));
  42. nl_handle_destroy(nl);
  43. return -1;
  44. }