isisd: allow to adjust lsp-mtu
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c
index 26efe4d..0c3f57f 100644
--- a/isisd/isis_pdu.c
+++ b/isisd/isis_pdu.c
@@ -1895,9 +1895,9 @@
if (entry->rem_lifetime && entry->checksum && entry->seq_num &&
memcmp (entry->lsp_id, isis->sysid, ISIS_SYS_ID_LEN))
{
- lsp = lsp_new (entry->lsp_id, ntohs (entry->rem_lifetime),
- 0, 0, entry->checksum, level);
- lsp->area = circuit->area;
+ lsp = lsp_new(circuit->area, entry->lsp_id,
+ ntohs(entry->rem_lifetime),
+ 0, 0, entry->checksum, level);
lsp_insert (lsp, circuit->area->lspdb[level - 1]);
ISIS_FLAGS_CLEAR_ALL (lsp->SRMflags);
ISIS_SET_FLAG (lsp->SSNflags, circuit);
@@ -2121,10 +2121,7 @@
circuit = THREAD_ARG (thread);
assert (circuit);
- if (circuit->rcv_stream == NULL)
- circuit->rcv_stream = stream_new (ISO_MTU (circuit));
- else
- stream_reset (circuit->rcv_stream);
+ isis_circuit_stream(circuit, &circuit->rcv_stream);
retval = circuit->rx (circuit, ssnpa);
circuit->t_read = NULL;
@@ -2160,10 +2157,7 @@
circuit->t_read = NULL;
- if (circuit->rcv_stream == NULL)
- circuit->rcv_stream = stream_new (ISO_MTU (circuit));
- else
- stream_reset (circuit->rcv_stream);
+ isis_circuit_stream(circuit, &circuit->rcv_stream);
retval = circuit->rx (circuit, ssnpa);
@@ -2268,10 +2262,7 @@
return ISIS_WARNING;
}
- if (!circuit->snd_stream)
- circuit->snd_stream = stream_new (ISO_MTU (circuit));
- else
- stream_reset (circuit->snd_stream);
+ isis_circuit_stream(circuit, &circuit->snd_stream);
if (circuit->circ_type == CIRCUIT_T_BROADCAST)
if (level == IS_LEVEL_1)
@@ -2527,10 +2518,7 @@
unsigned long auth_tlv_offset = 0;
int retval = ISIS_OK;
- if (circuit->snd_stream == NULL)
- circuit->snd_stream = stream_new (ISO_MTU (circuit));
- else
- stream_reset (circuit->snd_stream);
+ isis_circuit_stream(circuit, &circuit->snd_stream);
if (level == IS_LEVEL_1)
fill_fixed_hdr_andstream (&fixed_hdr, L1_COMPLETE_SEQ_NUM,
@@ -2854,10 +2842,7 @@
unsigned long auth_tlv_offset = 0;
int retval = ISIS_OK;
- if (circuit->snd_stream == NULL)
- circuit->snd_stream = stream_new (ISO_MTU (circuit));
- else
- stream_reset (circuit->snd_stream);
+ isis_circuit_stream(circuit, &circuit->snd_stream);
if (level == IS_LEVEL_1)
fill_fixed_hdr_andstream (&fixed_hdr, L1_PARTIAL_SEQ_NUM,
@@ -3179,10 +3164,7 @@
u_int16_t length;
struct isis_fixed_hdr fixed_hdr;
- if (!circuit->snd_stream)
- circuit->snd_stream = stream_new (ISO_MTU (circuit));
- else
- stream_reset (circuit->snd_stream);
+ isis_circuit_stream(circuit, &circuit->snd_stream);
// fill_llc_hdr (stream);
if (level == IS_LEVEL_1)