mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-01 03:16:03 +00:00
snmp_trap_header_sum(): use strlen() to get the length of community string
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
This commit is contained in:
parent
b5b5844119
commit
9b4564d7f3
@ -52,6 +52,8 @@
|
||||
#include "lwip/snmp_asn1.h"
|
||||
#include "lwip/snmp_msg.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
struct snmp_trap_dst
|
||||
{
|
||||
/* destination IP address in network order */
|
||||
@ -398,7 +400,7 @@ snmp_trap_header_sum(struct snmp_msg_trap *m_trap, u16_t vb_len)
|
||||
snmp_asn1_enc_length_cnt(thl->pdulen, &thl->pdulenlen);
|
||||
tot_len += 1 + thl->pdulenlen;
|
||||
|
||||
thl->comlen = sizeof(snmp_publiccommunity) - 1;
|
||||
thl->comlen = strlen(snmp_publiccommunity);
|
||||
snmp_asn1_enc_length_cnt(thl->comlen, &thl->comlenlen);
|
||||
tot_len += 1 + thl->comlenlen + thl->comlen;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user