mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-05 22:29:49 +00:00
Apply fix by Marco Veeneman in SNMPv3: The outbound_padding is calculated wrong in snmp_complete_outbound_frame()
This commit is contained in:
parent
12609c951c
commit
fefb782bfe
@ -1384,7 +1384,7 @@ snmp_complete_outbound_frame(struct snmp_request *request)
|
|||||||
/* Calculate padding for encryption */
|
/* Calculate padding for encryption */
|
||||||
if (request->version == SNMP_VERSION_3 && (request->msg_flags & SNMP_V3_PRIV_FLAG)) {
|
if (request->version == SNMP_VERSION_3 && (request->msg_flags & SNMP_V3_PRIV_FLAG)) {
|
||||||
u8_t i;
|
u8_t i;
|
||||||
outbound_padding = (u8_t)((frame_size - request->outbound_scoped_pdu_seq_offset) & 0x03);
|
outbound_padding = (8 - (u8_t)((frame_size - request->outbound_scoped_pdu_seq_offset) & 0x07)) & 0x07;
|
||||||
for (i = 0; i < outbound_padding; i++) {
|
for (i = 0; i < outbound_padding; i++) {
|
||||||
snmp_pbuf_stream_write(&request->outbound_pbuf_stream, 0);
|
snmp_pbuf_stream_write(&request->outbound_pbuf_stream, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user