Thomas Anders wrote:
> Checking 5.3.x CVS, I still/again(?) see byte order issues in udpTable
> for a number of platforms, including Linux/x86. Examples:
> 
> Linux/x86:
> UDP-MIB::udpLocalAddress.10.8.2.1.123 = IpAddress: 1.2.8.10
> UDP-MIB::udpLocalAddress.127.0.0.1.123 = IpAddress: 1.0.0.127
> UDP-MIB::udpLocalAddress.127.0.0.1.8765 = IpAddress: 1.0.0.127
> 
> Solaris/x86:
> UDP-MIB::udpLocalAddress.1.0.0.127.123 = IpAddress: 1.0.0.127
> UDP-MIB::udpLocalAddress.1.0.0.127.8765 = IpAddress: 1.0.0.127
> UDP-MIB::udpLocalAddress.23.2.8.10.123 = IpAddress: 23.2.8.10

Here's what I think is the culprit:
http://net-snmp.cvs.sourceforge.net/net-snmp/net-snmp/agent/mibgroup/mibII/udpTable.c?r1=5.20&r2=5.21

This commit meant to fix the behaviour for Solaris only, but obviously
did it the wrong way around, introducing a (wrong) change for the other
platforms.

I've attached a patch against 5.3.x CVS that adjusts the change to how
it was probably meant in the first place. It finally brings
udpLocalAddress handling in line with udpLocalPort handling.

I'm calling for votes to apply this to 5.3.1.


+Thomas

-- 
Thomas Anders (thomas.anders at blue-cable.de)
Index: ./agent/mibgroup/mibII/udpTable.c
===================================================================
RCS file: /cvsroot/net-snmp/net-snmp/agent/mibgroup/mibII/udpTable.c,v
retrieving revision 5.18.2.2
diff -u -r5.18.2.2 udpTable.c
--- ./agent/mibgroup/mibII/udpTable.c	26 May 2006 22:24:43 -0000	5.18.2.2
+++ ./agent/mibgroup/mibII/udpTable.c	21 Jun 2006 10:37:36 -0000
@@ -203,9 +203,9 @@
 #ifdef solaris2
                 /* solaris x86 already stores stuff in host order;
                    non x86 is already big endian host order as well */
-                addr = ntohl(entry->UDPTABLE_LOCALADDRESS);
-#else
                 addr = entry->UDPTABLE_LOCALADDRESS;
+#else
+                addr = ntohl(entry->UDPTABLE_LOCALADDRESS);
 #endif
 	        snmp_set_var_typed_value(requestvb, ASN_IPADDRESS,
                                          (u_char *)&addr,
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to