From 5a9afdfe022c331c5ff798f1bbba4c22abc6765c Mon Sep 17 00:00:00 2001 From: Hannes Gredler Date: Tue, 12 Sep 2023 08:24:36 +0000 Subject: [PATCH] correctly pad SID Index subTLV --- code/lspgen/src/lspgen_packet.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/lspgen/src/lspgen_packet.c b/code/lspgen/src/lspgen_packet.c index c9022d22..3a6b84a5 100644 --- a/code/lspgen/src/lspgen_packet.c +++ b/code/lspgen/src/lspgen_packet.c @@ -996,10 +996,11 @@ lspgen_serialize_ospf2_state(lsdb_attr_t *attr, lsdb_packet_t *packet, uint16_t /* Prefix SID - XXX Move this to Level 4*/ push_be_uint(buf2, 2, 2); /* Type */ - push_be_uint(buf2, 2, 7); /* Length */ + push_be_uint(buf2, 2, 8); /* Length */ push_be_uint(buf2, 3, 0); /* Flags, Reserved, MT-ID */ push_be_uint(buf2, 1, attr->key.prefix.sid_algo); /* Algorithm */ - push_be_uint(buf2, 3, attr->key.prefix.sid); /* SID Index */ + push_be_uint(buf2, 4, attr->key.prefix.sid); /* SID Index */ + push_pad4(buf2); write_be_uint(buf2->data+2, 2, buf2->idx-4); /* Update length */ push_pad4(buf2);