mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-11 08:54:38 +08:00
Fixed encoding of object sub identifiers with trailing zero.
This commit is contained in:
parent
473e567047
commit
c2f9d7dee0
@ -490,19 +490,20 @@ snmp_asn1_enc_oid(struct pbuf *p, u16_t ofs, u8_t ident_len, s32_t *ident)
|
|||||||
while (ident_len > 0)
|
while (ident_len > 0)
|
||||||
{
|
{
|
||||||
s32_t sub_id;
|
s32_t sub_id;
|
||||||
u8_t shift;
|
u8_t shift, tail;
|
||||||
|
|
||||||
ident_len--;
|
ident_len--;
|
||||||
sub_id = *ident;
|
sub_id = *ident;
|
||||||
|
tail = 0;
|
||||||
shift = 28;
|
shift = 28;
|
||||||
while(shift > 0)
|
while(shift > 0)
|
||||||
{
|
{
|
||||||
u8_t code;
|
u8_t code;
|
||||||
|
|
||||||
code = sub_id >> shift;
|
code = sub_id >> shift;
|
||||||
if (code != 0)
|
if ((code != 0) || (tail != 0))
|
||||||
{
|
{
|
||||||
|
tail = 1;
|
||||||
*msg_ptr = code | 0x80;
|
*msg_ptr = code | 0x80;
|
||||||
ofs += 1;
|
ofs += 1;
|
||||||
if (ofs >= plen)
|
if (ofs >= plen)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user