From 15bb334e81942260751c3a24dad243b4e8f60744 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 7 Oct 2015 10:41:03 +0200 Subject: [PATCH] SNMP: use PBUF_RAM for sending, PBUF_POOL is mostly used for RX only (if this isn't followed, tcp can get stuck when ACKs don't come through - unless some PBUF_POOL pbufs are reserved for such RX) --- src/core/snmp/msg_out.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/snmp/msg_out.c b/src/core/snmp/msg_out.c index 4b621c7e..988e8741 100644 --- a/src/core/snmp/msg_out.c +++ b/src/core/snmp/msg_out.c @@ -128,7 +128,7 @@ snmp_send_response(struct snmp_msg_pstat *m_stat) tot_len = snmp_resp_header_sum(m_stat, tot_len); /* try allocating pbuf(s) for complete response */ - p = pbuf_alloc(PBUF_TRANSPORT, tot_len, PBUF_POOL); + p = pbuf_alloc(PBUF_TRANSPORT, tot_len, PBUF_RAM); if (p == NULL) { LWIP_DEBUGF(SNMP_MSG_DEBUG, ("snmp_snd_response() tooBig\n")); @@ -139,7 +139,7 @@ snmp_send_response(struct snmp_msg_pstat *m_stat) tot_len = snmp_varbind_list_sum(&emptyvb); tot_len = snmp_resp_header_sum(m_stat, tot_len); /* retry allocation once for header and empty varbind-list */ - p = pbuf_alloc(PBUF_TRANSPORT, tot_len, PBUF_POOL); + p = pbuf_alloc(PBUF_TRANSPORT, tot_len, PBUF_RAM); } if (p != NULL) { /* first pbuf alloc try or retry alloc success */ @@ -250,7 +250,7 @@ snmp_send_trap(s8_t generic_trap, const struct snmp_obj_id *eoid, s32_t specific tot_len = snmp_trap_header_sum(&trap_msg, tot_len); /* allocate pbuf(s) */ - p = pbuf_alloc(PBUF_TRANSPORT, tot_len, PBUF_POOL); + p = pbuf_alloc(PBUF_TRANSPORT, tot_len, PBUF_RAM); if (p != NULL) { u16_t ofs;