aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2017-03-21 06:46:32 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2017-03-21 06:46:32 +0000
commit0eaf1a5942885a202750329946888c8b80cacf6a (patch)
tree2435acab799a988e4e26641b02dcb190659f79a8 /net-mgmt
parent715893f666570a277d7afb51bd660ffa37dbc36b (diff)
downloadports-0eaf1a5942885a202750329946888c8b80cacf6a.tar.gz
ports-0eaf1a5942885a202750329946888c8b80cacf6a.zip
Notes
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/net-snmp/Makefile2
-rw-r--r--net-mgmt/net-snmp/files/patch-agent_mibgroup_tcp-mib_data__access_tcpConn__freebsd4.c24
-rw-r--r--net-mgmt/net-snmp/files/patch-agent_mibgroup_udp-mib_data__access_udp__endpoint__freebsd4.c47
-rw-r--r--net-mgmt/net-snmp/files/patch-tcpTable.c39
-rw-r--r--net-mgmt/net-snmp/files/patch-udpTable.c26
5 files changed, 122 insertions, 16 deletions
diff --git a/net-mgmt/net-snmp/Makefile b/net-mgmt/net-snmp/Makefile
index 32022e8b9e55..61b2e1b9213a 100644
--- a/net-mgmt/net-snmp/Makefile
+++ b/net-mgmt/net-snmp/Makefile
@@ -3,7 +3,7 @@
PORTNAME= snmp
PORTVERSION= 5.7.3
-PORTREVISION= 12
+PORTREVISION= 13
CATEGORIES= net-mgmt ipv6
MASTER_SITES= SF/net-${PORTNAME}/net-${PORTNAME}/${PORTVERSION}
PKGNAMEPREFIX= net-
diff --git a/net-mgmt/net-snmp/files/patch-agent_mibgroup_tcp-mib_data__access_tcpConn__freebsd4.c b/net-mgmt/net-snmp/files/patch-agent_mibgroup_tcp-mib_data__access_tcpConn__freebsd4.c
index 1716f18e78d2..be881f1fd7c0 100644
--- a/net-mgmt/net-snmp/files/patch-agent_mibgroup_tcp-mib_data__access_tcpConn__freebsd4.c
+++ b/net-mgmt/net-snmp/files/patch-agent_mibgroup_tcp-mib_data__access_tcpConn__freebsd4.c
@@ -1,11 +1,23 @@
---- agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c.orig 2015-10-13 12:04:38 UTC
-+++ agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c
-@@ -216,6 +216,8 @@ _load(netsnmp_container *container, u_in
+--- agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c.orig 2017-03-15 18:15:07.000000000 +0000
++++ agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c 2017-03-15 18:15:07.000000000 +0000
+@@ -163,7 +163,11 @@
+ #else
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+ #endif
++#if __FreeBSD_version >= 1200026
++ state = StateMap[pcb.t_state];
++#else
+ state = StateMap[pcb.xt_tp.t_state];
++#endif
+
+ if (load_flags) {
+ if (state == TCPCONNECTIONSTATE_LISTEN) {
+@@ -215,6 +219,8 @@
+ entry->arbitrary_index = CONTAINER_SIZE(container) + 1;
CONTAINER_INSERT(container, entry);
}
-
-+ free(tcpcb_buf);
+
++ free(tcpcb_buf);
+
if(rc<0)
return rc;
-
diff --git a/net-mgmt/net-snmp/files/patch-agent_mibgroup_udp-mib_data__access_udp__endpoint__freebsd4.c b/net-mgmt/net-snmp/files/patch-agent_mibgroup_udp-mib_data__access_udp__endpoint__freebsd4.c
index 571c2a8e0534..17540b0a1817 100644
--- a/net-mgmt/net-snmp/files/patch-agent_mibgroup_udp-mib_data__access_udp__endpoint__freebsd4.c
+++ b/net-mgmt/net-snmp/files/patch-agent_mibgroup_udp-mib_data__access_udp__endpoint__freebsd4.c
@@ -1,11 +1,46 @@
---- agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c.orig 2015-10-13 12:04:44 UTC
-+++ agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c
-@@ -187,6 +187,8 @@ _load(netsnmp_container *container, u_in
+--- agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c.orig 2017-03-15 18:18:33.000000000 +0000
++++ agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c 2017-03-15 18:18:33.000000000 +0000
+@@ -164,9 +164,24 @@
+ }
+
+ /** oddly enough, these appear to already be in network order */
++#if __FreeBSD_version >= 1200026
++ entry->loc_port = htons(pcb.inp_lport);
++ entry->rmt_port = htons(pcb.inp_fport);
++
++ /** the addr string may need work */
++ if (pcb.inp_vflag & INP_IPV6) {
++ entry->loc_addr_len = entry->rmt_addr_len = 16;
++ memcpy(entry->loc_addr, &pcb.in6p_laddr, 16);
++ memcpy(entry->rmt_addr, &pcb.in6p_faddr, 16);
++ }
++ else {
++ entry->loc_addr_len = entry->rmt_addr_len = 4;
++ memcpy(entry->loc_addr, &pcb.inp_laddr, 4);
++ memcpy(entry->rmt_addr, &pcb.inp_faddr, 4);
++ }
++#else
+ entry->loc_port = htons(pcb.xi_inp.inp_lport);
+ entry->rmt_port = htons(pcb.xi_inp.inp_fport);
+- entry->pid = 0;
+
+ /** the addr string may need work */
+ if (pcb.xi_inp.inp_vflag & INP_IPV6) {
+@@ -179,6 +194,8 @@
+ memcpy(entry->loc_addr, &pcb.xi_inp.inp_laddr, 4);
+ memcpy(entry->rmt_addr, &pcb.xi_inp.inp_faddr, 4);
+ }
++#endif
++ entry->pid = 0;
+
+ /*
+ * add entry to container
+@@ -186,6 +203,8 @@
+ entry->index = CONTAINER_SIZE(container) + 1;
CONTAINER_INSERT(container, entry);
}
-
-+ free(udpcb_buf);
+
++ free(udpcb_buf);
+
if(rc<0)
return rc;
-
diff --git a/net-mgmt/net-snmp/files/patch-tcpTable.c b/net-mgmt/net-snmp/files/patch-tcpTable.c
index e01bba9327c9..03b2e57707f1 100644
--- a/net-mgmt/net-snmp/files/patch-tcpTable.c
+++ b/net-mgmt/net-snmp/files/patch-tcpTable.c
@@ -1,6 +1,18 @@
---- agent/mibgroup/mibII/tcpTable.c.orig 2011-07-01 19:35:46.000000000 -0300
-+++ agent/mibgroup/mibII/tcpTable.c 2011-07-27 10:00:57.000000000 -0300
-@@ -298,8 +298,10 @@
+--- agent/mibgroup/mibII/tcpTable.c.orig 2017-03-15 17:46:37.000000000 +0000
++++ agent/mibgroup/mibII/tcpTable.c 2017-03-15 17:46:37.000000000 +0000
+@@ -96,7 +96,11 @@
+
+ typedef struct netsnmp_inpcb_s netsnmp_inpcb;
+ struct netsnmp_inpcb_s {
++#if __FreeBSD_version >= 1200026
++ struct xinpcb pcb;
++#else
+ struct inpcb pcb;
++#endif
+ int state;
+ netsnmp_inpcb *inp_next;
+ };
+@@ -301,8 +305,10 @@
#ifndef NETSNMP_FEATURE_REMOVE_TCP_COUNT_CONNECTIONS
int
TCP_Count_Connections( void ) {
@@ -11,3 +23,24 @@
}
#endif /* NETSNMP_FEATURE_REMOVE_TCP_COUNT_CONNECTIONS */
+@@ -923,12 +929,20 @@
+ nnew = SNMP_MALLOC_TYPEDEF(netsnmp_inpcb);
+ if (!nnew)
+ break;
++#if __FreeBSD_version >= 1200026
++ nnew->state = StateMap[((NS_ELEM *) xig)->t_state];
++#else
+ nnew->state = StateMap[((NS_ELEM *) xig)->xt_tp.t_state];
++#endif
+ if (nnew->state == 5 /* established */ ||
+ nnew->state == 8 /* closeWait */ )
+ tcp_estab++;
+ memcpy(&(nnew->pcb), &(((NS_ELEM *) xig)->xt_inp),
++#if __FreeBSD_version >= 1200026
++ sizeof(struct xinpcb));
++#else
+ sizeof(struct inpcb));
++#endif
+
+ if (nnew->pcb.inp_vflag & INP_IPV6)
+ free(nnew);
diff --git a/net-mgmt/net-snmp/files/patch-udpTable.c b/net-mgmt/net-snmp/files/patch-udpTable.c
new file mode 100644
index 000000000000..4160298e6f02
--- /dev/null
+++ b/net-mgmt/net-snmp/files/patch-udpTable.c
@@ -0,0 +1,26 @@
+--- agent/mibgroup/mibII/udpTable.c.orig 2017-03-15 18:08:43.000000000 +0000
++++ agent/mibgroup/mibII/udpTable.c 2017-03-15 18:08:43.000000000 +0000
+@@ -71,7 +71,11 @@
+ #if defined(freebsd4) || defined(darwin) || defined(osf5)
+ typedef struct netsnmp_inpcb_s netsnmp_inpcb;
+ struct netsnmp_inpcb_s {
++#if __FreeBSD_version >= 1200026
++ struct xinpcb pcb;
++#else
+ struct inpcb pcb;
++#endif
+ int state;
+ netsnmp_inpcb *inp_next;
+ };
+@@ -670,7 +674,11 @@
+ nnew = SNMP_MALLOC_TYPEDEF(UDPTABLE_ENTRY_TYPE);
+ if (!nnew)
+ break;
++#if __FreeBSD_version >= 1200026
++ memcpy(&nnew->pcb, xig, sizeof(struct xinpcb));
++#else
+ memcpy(&nnew->pcb, &((struct xinpcb *) xig)->xi_inp, sizeof(struct inpcb));
++#endif
+ nnew->inp_next = udp_head;
+ udp_head = nnew;
+ #if defined(dragonfly)