diff --git a/src/core/snmp/msg_in.c b/src/core/snmp/msg_in.c index 90f1b1ba..a66fda80 100644 --- a/src/core/snmp/msg_in.c +++ b/src/core/snmp/msg_in.c @@ -50,8 +50,8 @@ /* public (non-static) constants */ /** SNMP v1 == 0 */ const s32_t snmp_version = 0; -/** default SNMP community string */ -const char snmp_publiccommunity[] = "public"; +/** SNMP community string */ +const char snmp_community[] = "public"; /* statically allocated buffers for SNMP_CONCURRENT_REQUESTS */ struct snmp_msg_pstat msg_input_list[SNMP_CONCURRENT_REQUESTS]; @@ -974,7 +974,7 @@ snmp_pdu_header_check(struct pbuf *p, u16_t ofs, u16_t pdu_len, u16_t *ofs_ret, len = ((len < (SNMP_COMMUNITY_STR_LEN))?(len):(SNMP_COMMUNITY_STR_LEN)); m_stat->community[len] = 0; m_stat->com_strlen = (u8_t)len; - if (strncmp(snmp_publiccommunity, (const char*)m_stat->community, SNMP_COMMUNITY_STR_LEN) != 0) + if (strncmp(snmp_community, (const char*)m_stat->community, SNMP_COMMUNITY_STR_LEN) != 0) { /** @todo: move this if we need to check more names */ snmp_inc_snmpinbadcommunitynames(); diff --git a/src/core/snmp/msg_out.c b/src/core/snmp/msg_out.c index e9baef49..3de9d154 100644 --- a/src/core/snmp/msg_out.c +++ b/src/core/snmp/msg_out.c @@ -400,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 = strlen(snmp_publiccommunity); + thl->comlen = strlen(snmp_community); snmp_asn1_enc_length_cnt(thl->comlen, &thl->comlenlen); tot_len += 1 + thl->comlenlen + thl->comlen; @@ -567,7 +567,7 @@ snmp_trap_header_enc(struct snmp_msg_trap *m_trap, struct pbuf *p) ofs += 1; snmp_asn1_enc_length(p, ofs, m_trap->thl.comlen); ofs += m_trap->thl.comlenlen; - snmp_asn1_enc_raw(p, ofs, m_trap->thl.comlen, (u8_t *)&snmp_publiccommunity[0]); + snmp_asn1_enc_raw(p, ofs, m_trap->thl.comlen, (u8_t *)&snmp_community[0]); ofs += m_trap->thl.comlen; snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_CONTXT | SNMP_ASN1_CONSTR | SNMP_ASN1_PDU_TRAP)); diff --git a/src/include/lwip/snmp_msg.h b/src/include/lwip/snmp_msg.h index 44c5ff09..a4d4ad76 100644 --- a/src/include/lwip/snmp_msg.h +++ b/src/include/lwip/snmp_msg.h @@ -282,8 +282,8 @@ struct snmp_msg_trap /** Agent Version constant, 0 = v1 oddity */ extern const s32_t snmp_version; -/** Agent default "public" community string */ -extern const char snmp_publiccommunity[]; +/** Agent community string */ +extern const char snmp_community[]; extern struct snmp_msg_trap trap_msg;