changeset 3252:2dba5f2af421

* src/core/snmp/msg_out.c: Applied lwip bugfix #29256. ip_addr_set_hton(...) does not exist in this revision, so an equivalent solution was provided. The application was retested. Any application that worked around the problem by using htonl(...) will need to be changed by removing it. [ Bugzilla 1001789 ]
author jld
date Sat, 22 Jun 2013 14:58:09 +0000
parents a27026771dae
children f2e7134c0eec
files packages/net/lwip_tcpip/current/ChangeLog packages/net/lwip_tcpip/current/src/core/snmp/msg_out.c
diffstat 2 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/packages/net/lwip_tcpip/current/ChangeLog
+++ b/packages/net/lwip_tcpip/current/ChangeLog
@@ -1,3 +1,12 @@
+2013-03-03  Mike Jones  <mike@proclivis.com>
+
+	* src/core/snmp/msg_out.c: Applied lwip bugfix #29256.
+	ip_addr_set_hton(...) does not exist in this revision,
+	so an equivalent solution was provided. The application
+	was retested. Any application that worked around the problem by
+	using htonl(...) will need to be changed by removing it.
+	[ Bugzilla 1001789 ]
+
 2012-05-26  Ilija Kocho  <ilijak@siva.com.mk>
 
 	* tests/nc_test_slave.c: Reduced stack sizes of IDLE, LOAD and TMAIN
--- a/packages/net/lwip_tcpip/current/src/core/snmp/msg_out.c
+++ b/packages/net/lwip_tcpip/current/src/core/snmp/msg_out.c
@@ -96,7 +96,7 @@ snmp_trap_dst_ip_set(u8_t dst_idx, struc
 {
   if (dst_idx < SNMP_TRAP_DESTINATIONS)
   {
-    trap_dst[dst_idx].dip.addr = htonl(dst->addr);
+    trap_dst[dst_idx].dip.addr = dst->addr;
   }
 }
 
@@ -269,11 +269,8 @@ snmp_send_trap(s8_t generic_trap, struct
         snmp_inc_snmpouttraps();
         snmp_inc_snmpoutpkts();
 
-        /** connect to the TRAP destination */
-        udp_connect(trap_msg.pcb, &trap_msg.dip, SNMP_TRAP_PORT);
-        udp_send(trap_msg.pcb, p);
-        /** disassociate remote address and port with this pcb */
-        udp_disconnect(trap_msg.pcb);
+        /** send to the TRAP destination */
+        udp_sendto(trap_msg.pcb, p, &trap_msg.dip, SNMP_TRAP_PORT);
 
         pbuf_free(p);
       }