handle ifmedia64

interface_openbsd.c seems unused but patch there as well anyway in case
anything else uses it later..
This commit is contained in:
sthen 2015-09-11 16:33:05 +00:00
parent 5d220a595f
commit 1c94df2da7
3 changed files with 45 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.80 2015/04/13 08:41:36 sthen Exp $
# $OpenBSD: Makefile,v 1.81 2015/09/11 16:33:05 sthen Exp $
SHARED_ONLY= Yes
@ -6,7 +6,7 @@ COMMENT-main= extendable SNMP implementation
COMMENT-tkmib= graphical SNMP MIB browser
V= 5.7.3
REVISION-main= 0
REVISION-main= 1
DISTNAME= net-snmp-$V
MULTI_PACKAGES= -main -tkmib

View File

@ -0,0 +1,22 @@
$OpenBSD: patch-agent_mibgroup_if-mib_data_access_interface_openbsd_c,v 1.1 2015/09/11 16:33:05 sthen Exp $
--- agent/mibgroup/if-mib/data_access/interface_openbsd.c.orig Fri Sep 11 10:30:14 2015
+++ agent/mibgroup/if-mib/data_access/interface_openbsd.c Fri Sep 11 10:31:45 2015
@@ -333,7 +333,8 @@ netsnmp_openbsd_interface_get_if_speed(char *name, u_i
{
int s;
struct ifmediareq ifmr;
- int *media_list, i;
+ int i;
+ uint64_t *media_list;
u_int t_speed, t_speed_high;
u_int m_speed, m_speed_high;
@@ -360,7 +361,7 @@ netsnmp_openbsd_interface_get_if_speed(char *name, u_i
_openbsd_interface_ifmedia_to_speed(ifmr.ifm_current, speed, speed_high);
if (*speed == 0 &&
- (media_list = (int *) malloc(ifmr.ifm_count * sizeof(int))) != NULL ) {
+ (media_list = (uint64_t *) malloc(ifmr.ifm_count * sizeof(uint64_t))) != NULL ) {
ifmr.ifm_ulist = media_list;

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-agent_mibgroup_if-mib_data_access_interface_sysctl_c,v 1.5 2015/09/11 16:33:05 sthen Exp $
--- agent/mibgroup/if-mib/data_access/interface_sysctl.c.orig Fri Sep 11 10:30:28 2015
+++ agent/mibgroup/if-mib/data_access/interface_sysctl.c Fri Sep 11 10:30:46 2015
@@ -241,7 +241,7 @@ netsnmp_sysctl_get_if_speed(char *name, u_int *speed,
{
int s;
struct ifmediareq ifmr;
- int *media_list, i;
+ uint64_t *media_list, i;
u_int t_speed, t_speed_high;
u_int m_speed, m_speed_high;
@@ -272,7 +272,7 @@ netsnmp_sysctl_get_if_speed(char *name, u_int *speed,
netsnmp_sysctl_ifmedia_to_speed(ifmr.ifm_current, speed, speed_high);
if (*speed == 0 &&
- (media_list = (int *) malloc(ifmr.ifm_count * sizeof(int))) != NULL ) {
+ (media_list = (uint64_t *) malloc(ifmr.ifm_count * sizeof(uint64_t))) != NULL ) {
ifmr.ifm_ulist = media_list;