--- a/agent/mibgroup/mibII/tcpTable.c	2014-12-08 12:23:22.000000000 -0800
+++ b/agent/mibgroup/mibII/tcpTable.c	2015-01-06 16:09:14.245207029 -0800
@@ -653,8 +653,16 @@
 				running = 0;
 				break;
 			}
-
-			r = nlmsg_data(h);
+         // handle the case where the kernel doesn't have netlink socket 
+         // diagnostics enabled
+         if ((h->nlmsg_type == NLMSG_ERROR) && 
+             (((struct nlmsgerr *)r)->error != 0)) {
+            int nlerr = ((struct nlmsgerr *)r)->error;
+            running = 0;
+            DEBUGMSGTL(("mibII/tcpTable", "netlink error: %d\n", nlerr));
+            snmp_log(LOG_ERR, "snmpd: netlink error: %d\n", nlerr);
+            break;
+         }
 
 			if (r->idiag_family != AF_INET) {
 				h = nlmsg_next(h, &len);
