diff -up net-snmp-5.4.1/agent/mibgroup/mibII/at.c.backup_patch_5 net-snmp-5.4.1/agent/mibgroup/mibII/at.c --- net-snmp-5.4.1/agent/mibgroup/mibII/at.c.backup_patch_5 2006-12-27 20:17:49.000000000 +0100 +++ net-snmp-5.4.1/agent/mibgroup/mibII/at.c 2008-07-25 12:53:03.000000000 +0200 @@ -128,9 +128,9 @@ #ifndef solaris2 static void ARP_Scan_Init(void); #ifdef ARP_SCAN_FOUR_ARGUMENTS -static int ARP_Scan_Next(u_long *, char *, u_long *, u_short *); +static int ARP_Scan_Next(u_int *, char *, u_long *, u_short *); #else -static int ARP_Scan_Next(u_long *, char *, u_long *); +static int ARP_Scan_Next(u_int *, char *, u_long *); #endif #endif #endif @@ -206,7 +206,8 @@ var_atEntry(struct variable *vp, oid lowest[16]; oid current[16]; static char PhysAddr[6], LowPhysAddr[6]; - u_long Addr, LowAddr, foundone; + u_int Addr, LowAddr, foundone; + static int addr_ret; #ifdef ARP_SCAN_FOUR_ARGUMENTS u_short ifIndex, lowIfIndex = 0; #endif /* ARP_SCAN_FOUR_ARGUMENTS */ @@ -316,9 +317,9 @@ var_atEntry(struct variable *vp, *var_len = sizeof(LowPhysAddr); return (u_char *) LowPhysAddr; case IPMEDIANETADDRESS: /* also ATNETADDRESS */ - *var_len = sizeof(uint32_t); - long_return = LowAddr; - return (u_char *) & long_return; + *var_len = sizeof addr_ret; + addr_ret = LowAddr; + return (u_char *) & addr_ret; case IPMEDIATYPE: *var_len = sizeof long_return; long_return = lowIfType; @@ -709,11 +710,11 @@ ARP_Scan_Init(void) #ifdef ARP_SCAN_FOUR_ARGUMENTS static int -ARP_Scan_Next(u_long * IPAddr, char *PhysAddr, u_long * ifType, +ARP_Scan_Next(u_int * IPAddr, char *PhysAddr, u_long * ifType, u_short * ifIndex) #else static int -ARP_Scan_Next(u_long * IPAddr, char *PhysAddr, u_long * ifType) +ARP_Scan_Next(u_int * IPAddr, char *PhysAddr, u_long * ifType) #endif { #ifndef NETSNMP_CAN_USE_SYSCTL diff -up net-snmp-5.4.1/agent/mibgroup/mibII/ipCidrRouteTable_access.c.backup_patch_5 net-snmp-5.4.1/agent/mibgroup/mibII/ipCidrRouteTable_access.c --- net-snmp-5.4.1/agent/mibgroup/mibII/ipCidrRouteTable_access.c.backup_patch_5 2003-02-22 05:19:51.000000000 +0100 +++ net-snmp-5.4.1/agent/mibgroup/mibII/ipCidrRouteTable_access.c 2008-07-25 12:53:03.000000000 +0200 @@ -22,6 +22,7 @@ /** a global static we'll make use of a lot to map to the right datatype to return (which for SNMP integer's is always a long). */ static u_long long_ret; +static in_addr_t addr_ret; /* @@ -32,18 +33,18 @@ u_long * get_ipCidrRouteDest(void *data_context, size_t * ret_len) { RTENTRY *ourroute = (RTENTRY *) data_context; - long_ret = ((struct sockaddr_in *) (&ourroute->rt_dst))->sin_addr.s_addr; - *ret_len = sizeof(long_ret); - return &long_ret; + addr_ret = ((struct sockaddr_in *) (&ourroute->rt_dst))->sin_addr.s_addr; + *ret_len = sizeof(addr_ret); + return &addr_ret; } u_long * get_ipCidrRouteMask(void *data_context, size_t * ret_len) { RTENTRY *ourroute = (RTENTRY *) data_context; - long_ret = ((struct sockaddr_in *) (&ourroute->rt_genmask))->sin_addr.s_addr; - *ret_len = sizeof(long_ret); - return &long_ret; + addr_ret = ((struct sockaddr_in *) (&ourroute->rt_genmask))->sin_addr.s_addr; + *ret_len = sizeof(addr_ret); + return &addr_ret; } long * @@ -59,9 +60,9 @@ u_long * get_ipCidrRouteNextHop(void *data_context, size_t * ret_len) { RTENTRY *ourroute = (RTENTRY *) data_context; - long_ret = ((struct sockaddr_in *) (&ourroute->rt_gateway))->sin_addr.s_addr; - *ret_len = sizeof(long_ret); - return &long_ret; + addr_ret = ((struct sockaddr_in *) (&ourroute->rt_gateway))->sin_addr.s_addr; + *ret_len = sizeof(addr_ret); + return &addr_ret; } long * diff -up net-snmp-5.4.1/agent/mibgroup/mibII/var_route.c.backup_patch_5 net-snmp-5.4.1/agent/mibgroup/mibII/var_route.c --- net-snmp-5.4.1/agent/mibgroup/mibII/var_route.c.backup_patch_5 2006-11-07 00:43:27.000000000 +0100 +++ net-snmp-5.4.1/agent/mibgroup/mibII/var_route.c 2008-07-25 12:53:03.000000000 +0200 @@ -434,6 +434,7 @@ var_ipRouteEntry(struct variable * vp, static oid saveName[MAX_OID_LEN], Current[MAX_OID_LEN]; u_char *cp; oid *op; + static in_addr_t addr_ret; #if NEED_KLGETSA struct sockaddr_in *sa; #endif @@ -538,13 +539,13 @@ var_ipRouteEntry(struct variable * vp, switch (vp->magic) { case IPROUTEDEST: - *var_len = sizeof(uint32_t); + *var_len = sizeof(addr_ret); #if NEED_KLGETSA sa = klgetsa((struct sockaddr_in *) rthead[RtIndex]->rt_dst); return (u_char *) & (sa->sin_addr.s_addr); #elif defined(hpux11) - long_return = rt[RtIndex].Dest; - return (u_char *) & long_return; + addr_ret = rt[RtIndex].Dest; + return (u_char *) & addr_ret; #else return (u_char *) & ((struct sockaddr_in *) &rthead[RtIndex]-> rt_dst)->sin_addr.s_addr; @@ -597,13 +598,13 @@ var_ipRouteEntry(struct variable * vp, long_return = -1; return (u_char *) & long_return; case IPROUTENEXTHOP: - *var_len = sizeof(uint32_t); + *var_len = sizeof(addr_ret); #if NEED_KLGETSA sa = klgetsa((struct sockaddr_in *) rthead[RtIndex]->rt_gateway); return (u_char *) & (sa->sin_addr.s_addr); #elif defined(hpux11) - long_return = rt[RtIndex].NextHop; - return (u_char *) & long_return; + addr_ret = rt[RtIndex].NextHop; + return (u_char *) & addr_ret; #else return (u_char *) & ((struct sockaddr_in *) &rthead[RtIndex]-> rt_gateway)->sin_addr.s_addr; @@ -649,14 +650,14 @@ var_ipRouteEntry(struct variable * vp, #if NETSNMP_NO_DUMMY_VALUES return NULL; #endif - long_return = 0; + addr_ret = 0; #elif defined(hpux11) - long_return = rt[RtIndex].Mask; - return (u_char *) & long_return; + addr_ret = rt[RtIndex].Mask; + return (u_char *) & addr_ret; #else /* !NEED_KLGETSA && !hpux11 */ if (((struct sockaddr_in *) &rthead[RtIndex]->rt_dst)->sin_addr. s_addr == 0) - long_return = 0; /* Default route */ + addr_ret = 0; /* Default route */ else { #ifndef linux if (!NETSNMP_KLOOKUP(rthead[RtIndex]->rt_ifp, @@ -681,7 +682,7 @@ var_ipRouteEntry(struct variable * vp, #endif /* linux */ } #endif /* NEED_KLGETSA */ - return (u_char *) & long_return; + return (u_char *) & addr_ret; case IPROUTEINFO: *var_len = nullOidLen; return (u_char *) nullOid; diff -up net-snmp-5.4.1/agent/mibgroup/ucd-snmp/pass.c.backup_patch_5 net-snmp-5.4.1/agent/mibgroup/ucd-snmp/pass.c --- net-snmp-5.4.1/agent/mibgroup/ucd-snmp/pass.c.backup_patch_5 2005-08-18 02:44:02.000000000 +0200 +++ net-snmp-5.4.1/agent/mibgroup/ucd-snmp/pass.c 2008-07-25 12:53:03.000000000 +0200 @@ -287,6 +287,7 @@ var_extensible_pass(struct variable *vp, oid newname[MAX_OID_LEN]; int i, rtest, fd, newlen; static long long_ret; + static in_addr_t addr_ret; char buf[SNMP_MAXBUF]; static char buf2[SNMP_MAXBUF]; static oid objid[MAX_OID_LEN]; @@ -412,13 +413,13 @@ var_extensible_pass(struct variable *vp, *var_len = 0; return (NULL); } - long_ret = + addr_ret = (objid[0] << (8 * 3)) + (objid[1] << (8 * 2)) + (objid[2] << 8) + objid[3]; - long_ret = htonl(long_ret); - *var_len = sizeof(long_ret); + addr_ret = htonl(addr_ret); + *var_len = sizeof(addr_ret); vp->type = ASN_IPADDRESS; - return ((unsigned char *) &long_ret); + return ((unsigned char *) &addr_ret); } } *var_len = 0; diff -up net-snmp-5.4.1/agent/mibgroup/ucd-snmp/pass_persist.c.backup_patch_5 net-snmp-5.4.1/agent/mibgroup/ucd-snmp/pass_persist.c --- net-snmp-5.4.1/agent/mibgroup/ucd-snmp/pass_persist.c.backup_patch_5 2006-10-18 04:59:10.000000000 +0200 +++ net-snmp-5.4.1/agent/mibgroup/ucd-snmp/pass_persist.c 2008-07-25 12:53:03.000000000 +0200 @@ -218,6 +218,7 @@ var_extensible_pass_persist(struct varia oid newname[MAX_OID_LEN]; int i, rtest, newlen; static long long_ret; + static in_addr_t addr_ret; char buf[SNMP_MAXBUF]; static char buf2[SNMP_MAXBUF]; static oid objid[MAX_OID_LEN]; @@ -366,13 +367,13 @@ var_extensible_pass_persist(struct varia *var_len = 0; return (NULL); } - long_ret = + addr_ret = (objid[0] << (8 * 3)) + (objid[1] << (8 * 2)) + (objid[2] << 8) + objid[3]; - long_ret = htonl(long_ret); - *var_len = sizeof(long_ret); + addr_ret = htonl(addr_ret); + *var_len = sizeof(addr_ret); vp->type = ASN_IPADDRESS; - return ((unsigned char *) &long_ret); + return ((unsigned char *) &addr_ret); } } *var_len = 0;