Picking out a few things I've had patched in the OpenBSD port for ages.
This one is needed for 5.9+ (released in 2016 - OpenBSD has two releases
per year and only supports the most recent two) but is harmless for older
versions.

>From e009c576f5c6bafeebaa92654b32b18380289761 Mon Sep 17 00:00:00 2001
From: Stuart Henderson <s...@spacehopper.org>
Date: Fri, 4 May 2018 13:32:27 +0100
Subject: [PATCH 1/2] ifm_media changed from u_int to uint64_t in OpenBSD 5.9

Signed-off-by: Stuart Henderson <st...@openbsd.org>
---
 agent/mibgroup/if-mib/data_access/interface_openbsd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/agent/mibgroup/if-mib/data_access/interface_openbsd.c 
b/agent/mibgroup/if-mib/data_access/interface_openbsd.c
index 26cd46c5b..06b4f9567 100644
--- a/agent/mibgroup/if-mib/data_access/interface_openbsd.c
+++ b/agent/mibgroup/if-mib/data_access/interface_openbsd.c
@@ -334,7 +334,8 @@ netsnmp_openbsd_interface_get_if_speed(char *name, u_int 
*speed, u_int *speed_hi
 {
     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;
 
@@ -361,7 +362,7 @@ netsnmp_openbsd_interface_get_if_speed(char *name, u_int 
*speed, u_int *speed_hi
     _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;
 
-- 
2.16.2



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to