diff --git a/src/apps/snmp/snmp_msg.c b/src/apps/snmp/snmp_msg.c index 9c0a15c52..f8c75bb7f 100644 --- a/src/apps/snmp/snmp_msg.c +++ b/src/apps/snmp/snmp_msg.c @@ -328,7 +328,6 @@ snmp_receive(void *handle, struct pbuf *p, const ip_addr_t *source_ip, u16_t por struct snmp_varbind vb; vb.next = NULL; - vb.prev = NULL; vb.type = SNMP_ASN1_TYPE_COUNTER32; vb.value_len = sizeof(u32_t); diff --git a/src/apps/snmp/snmp_traps.c b/src/apps/snmp/snmp_traps.c index 4acbe6047..7c6d536fa 100644 --- a/src/apps/snmp/snmp_traps.c +++ b/src/apps/snmp/snmp_traps.c @@ -351,13 +351,11 @@ snmp_send_trap_or_notification_or_inform_generic(struct snmp_msg_trap *trap_msg, u16_t tot_len = 0; err_t err = ERR_OK; u32_t timestamp = 0; - struct snmp_varbind *original_varbinds = varbinds; - struct snmp_varbind *original_prev = NULL; + struct snmp_obj_id snmp_trap_oid = { 0 }; /* used for converting SNMPv1 generic/specific trap parameter to SNMPv2 snmpTrapOID */ struct snmp_varbind snmp_v2_special_varbinds[] = { /* First varbind is used to store sysUpTime */ { NULL, /* *next */ - NULL, /* *prev */ { /* oid */ 8, /* oid len */ {1, 3, 6, 1, 2, 1, 1, 3} /* oid for sysUpTime */ @@ -369,7 +367,6 @@ snmp_send_trap_or_notification_or_inform_generic(struct snmp_msg_trap *trap_msg, /* Second varbind is used to store snmpTrapOID */ { NULL, /* *next */ - NULL, /* *prev */ { /* oid */ 10, /* oid len */ {1, 3, 6, 1, 6, 3, 1, 1, 4, 1} /* oid for snmpTrapOID */ @@ -383,7 +380,6 @@ snmp_send_trap_or_notification_or_inform_generic(struct snmp_msg_trap *trap_msg, LWIP_ASSERT_SNMP_LOCKED(); snmp_v2_special_varbinds[0].next = &snmp_v2_special_varbinds[1]; - snmp_v2_special_varbinds[1].prev = &snmp_v2_special_varbinds[0]; snmp_v2_special_varbinds[0].value = ×tamp; @@ -391,15 +387,10 @@ snmp_send_trap_or_notification_or_inform_generic(struct snmp_msg_trap *trap_msg, /* see rfc3584 */ if (trap_msg->snmp_version == SNMP_VERSION_2c) { - struct snmp_obj_id snmp_trap_oid = { 0 }; /* used for converting SNMPv1 generic/specific trap parameter to SNMPv2 snmpTrapOID */ err = snmp_prepare_trap_oid(&snmp_trap_oid, eoid, generic_trap, specific_trap); if (err == ERR_OK) { snmp_v2_special_varbinds[1].value_len = snmp_trap_oid.len * sizeof(snmp_trap_oid.id[0]); snmp_v2_special_varbinds[1].value = snmp_trap_oid.id; - if (varbinds != NULL) { - original_prev = varbinds->prev; - varbinds->prev = &snmp_v2_special_varbinds[1]; - } varbinds = snmp_v2_special_varbinds; /* After inserting two varbinds at the beginning of the list, make sure that pointer is pointing to the first element */ } } @@ -422,9 +413,6 @@ snmp_send_trap_or_notification_or_inform_generic(struct snmp_msg_trap *trap_msg, } } } - if ((trap_msg->snmp_version == SNMP_VERSION_2c) && (original_varbinds != NULL)) { - original_varbinds->prev = original_prev; - } req_id++; return err; } diff --git a/src/include/lwip/apps/snmp.h b/src/include/lwip/apps/snmp.h index dc5bb0d05..d01f99b81 100644 --- a/src/include/lwip/apps/snmp.h +++ b/src/include/lwip/apps/snmp.h @@ -55,8 +55,6 @@ struct snmp_varbind { /** pointer to next varbind, NULL for last in list */ struct snmp_varbind *next; - /** pointer to previous varbind, NULL for first in list */ - struct snmp_varbind *prev; /** object identifier */ struct snmp_obj_id oid;