From 74f1019c3188b5e6007ff2dff8a3ca7cbf9022ac Mon Sep 17 00:00:00 2001 From: Jun Kuriyama Date: Sat, 21 Feb 2009 11:18:41 +0000 Subject: Fix counter breakage on 64bit arch. Reported by: sem Obtained from: http://sourceforge.net/tracker/index.php?func=detail&aid=2435793&group_id=12694&atid=312694 --- net-mgmt/net-snmp-devel/Makefile | 2 +- .../net-snmp-devel/files/patch-interface_sysctl.c | 41 ++++++++++++++++++++++ net-mgmt/net-snmp/Makefile | 2 +- net-mgmt/net-snmp/files/patch-interface_sysctl.c | 41 ++++++++++++++++++++++ 4 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 net-mgmt/net-snmp-devel/files/patch-interface_sysctl.c create mode 100644 net-mgmt/net-snmp/files/patch-interface_sysctl.c diff --git a/net-mgmt/net-snmp-devel/Makefile b/net-mgmt/net-snmp-devel/Makefile index 27dd4dc55838..1f1e4bae0c93 100644 --- a/net-mgmt/net-snmp-devel/Makefile +++ b/net-mgmt/net-snmp-devel/Makefile @@ -7,7 +7,7 @@ PORTNAME= snmp PORTVERSION= 5.4.2.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net-mgmt ipv6 MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= net-snmp diff --git a/net-mgmt/net-snmp-devel/files/patch-interface_sysctl.c b/net-mgmt/net-snmp-devel/files/patch-interface_sysctl.c new file mode 100644 index 000000000000..262e9c7c12ab --- /dev/null +++ b/net-mgmt/net-snmp-devel/files/patch-interface_sysctl.c @@ -0,0 +1,41 @@ +Index: agent/mibgroup/if-mib/data_access/interface_sysctl.c +=================================================================== +--- agent/mibgroup/if-mib/data_access/interface_sysctl.c (revision 17324) ++++ agent/mibgroup/if-mib/data_access/interface_sysctl.c (working copy) +@@ -451,22 +451,22 @@ + NETSNMP_INTERFACE_FLAGS_HAS_V6_REASMMAX; + + /* get counters */ +- entry->stats.ibytes.low = ifp->ifm_data.ifi_ibytes; +- entry->stats.ibytes.high = 0; +- entry->stats.iucast.low = ifp->ifm_data.ifi_ipackets; +- entry->stats.iucast.high = 0; +- entry->stats.imcast.low = ifp->ifm_data.ifi_imcasts; +- entry->stats.imcast.high = 0; ++ entry->stats.ibytes.low = ifp->ifm_data.ifi_ibytes & 0xffffffff; ++ entry->stats.ibytes.high = ifp->ifm_data.ifi_ibytes >> 32; ++ entry->stats.iucast.low = ifp->ifm_data.ifi_ipackets & 0xffffffff; ++ entry->stats.iucast.high = ifp->ifm_data.ifi_ipackets >> 32; ++ entry->stats.imcast.low = ifp->ifm_data.ifi_imcasts & 0xffffffff; ++ entry->stats.imcast.high = ifp->ifm_data.ifi_imcasts >> 32; + entry->stats.ierrors = ifp->ifm_data.ifi_ierrors; + entry->stats.idiscards = ifp->ifm_data.ifi_iqdrops; + entry->stats.iunknown_protos = ifp->ifm_data.ifi_noproto; + +- entry->stats.obytes.low = ifp->ifm_data.ifi_obytes; +- entry->stats.obytes.high = 0; +- entry->stats.oucast.low = ifp->ifm_data.ifi_opackets; +- entry->stats.oucast.high = 0; +- entry->stats.omcast.low = ifp->ifm_data.ifi_omcasts; +- entry->stats.omcast.high = 0; ++ entry->stats.obytes.low = ifp->ifm_data.ifi_obytes & 0xffffffff; ++ entry->stats.obytes.high = ifp->ifm_data.ifi_obytes >> 32; ++ entry->stats.oucast.low = ifp->ifm_data.ifi_opackets & 0xffffffff; ++ entry->stats.oucast.high = ifp->ifm_data.ifi_opackets >> 32; ++ entry->stats.omcast.low = ifp->ifm_data.ifi_omcasts & 0xffffffff; ++ entry->stats.omcast.high = ifp->ifm_data.ifi_omcasts >> 32; + entry->stats.oerrors = ifp->ifm_data.ifi_oerrors; + entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_BYTES | + NETSNMP_INTERFACE_FLAGS_HAS_DROPS | + + diff --git a/net-mgmt/net-snmp/Makefile b/net-mgmt/net-snmp/Makefile index 27dd4dc55838..1f1e4bae0c93 100644 --- a/net-mgmt/net-snmp/Makefile +++ b/net-mgmt/net-snmp/Makefile @@ -7,7 +7,7 @@ PORTNAME= snmp PORTVERSION= 5.4.2.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net-mgmt ipv6 MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= net-snmp diff --git a/net-mgmt/net-snmp/files/patch-interface_sysctl.c b/net-mgmt/net-snmp/files/patch-interface_sysctl.c new file mode 100644 index 000000000000..262e9c7c12ab --- /dev/null +++ b/net-mgmt/net-snmp/files/patch-interface_sysctl.c @@ -0,0 +1,41 @@ +Index: agent/mibgroup/if-mib/data_access/interface_sysctl.c +=================================================================== +--- agent/mibgroup/if-mib/data_access/interface_sysctl.c (revision 17324) ++++ agent/mibgroup/if-mib/data_access/interface_sysctl.c (working copy) +@@ -451,22 +451,22 @@ + NETSNMP_INTERFACE_FLAGS_HAS_V6_REASMMAX; + + /* get counters */ +- entry->stats.ibytes.low = ifp->ifm_data.ifi_ibytes; +- entry->stats.ibytes.high = 0; +- entry->stats.iucast.low = ifp->ifm_data.ifi_ipackets; +- entry->stats.iucast.high = 0; +- entry->stats.imcast.low = ifp->ifm_data.ifi_imcasts; +- entry->stats.imcast.high = 0; ++ entry->stats.ibytes.low = ifp->ifm_data.ifi_ibytes & 0xffffffff; ++ entry->stats.ibytes.high = ifp->ifm_data.ifi_ibytes >> 32; ++ entry->stats.iucast.low = ifp->ifm_data.ifi_ipackets & 0xffffffff; ++ entry->stats.iucast.high = ifp->ifm_data.ifi_ipackets >> 32; ++ entry->stats.imcast.low = ifp->ifm_data.ifi_imcasts & 0xffffffff; ++ entry->stats.imcast.high = ifp->ifm_data.ifi_imcasts >> 32; + entry->stats.ierrors = ifp->ifm_data.ifi_ierrors; + entry->stats.idiscards = ifp->ifm_data.ifi_iqdrops; + entry->stats.iunknown_protos = ifp->ifm_data.ifi_noproto; + +- entry->stats.obytes.low = ifp->ifm_data.ifi_obytes; +- entry->stats.obytes.high = 0; +- entry->stats.oucast.low = ifp->ifm_data.ifi_opackets; +- entry->stats.oucast.high = 0; +- entry->stats.omcast.low = ifp->ifm_data.ifi_omcasts; +- entry->stats.omcast.high = 0; ++ entry->stats.obytes.low = ifp->ifm_data.ifi_obytes & 0xffffffff; ++ entry->stats.obytes.high = ifp->ifm_data.ifi_obytes >> 32; ++ entry->stats.oucast.low = ifp->ifm_data.ifi_opackets & 0xffffffff; ++ entry->stats.oucast.high = ifp->ifm_data.ifi_opackets >> 32; ++ entry->stats.omcast.low = ifp->ifm_data.ifi_omcasts & 0xffffffff; ++ entry->stats.omcast.high = ifp->ifm_data.ifi_omcasts >> 32; + entry->stats.oerrors = ifp->ifm_data.ifi_oerrors; + entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_BYTES | + NETSNMP_INTERFACE_FLAGS_HAS_DROPS | + + -- cgit v1.2.3