From a2d41bb0ee1d18353f9cb58c9073f5805e0903ee Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Tue, 5 Jun 2018 20:50:59 +0200 Subject: [PATCH] fabricd: Remove processing for unneded PDUs and TLVs The OpenFabric draft prescribes that any IS-IS PDUs not needed for OpenFabric operation MUST be ignored. So this commit makes fabricd ignore any LAN IIHs and any L1 LSPs. Also the draft specifies that any reachabilities given as narrow-metric TLVs SHALL be ignored, so adhere to that too. Signed-off-by: Christian Franke --- isisd/isis_pdu.c | 6 ++++++ isisd/isis_spf.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c index 8649c5a0c8..d5e9704b02 100644 --- a/isisd/isis_pdu.c +++ b/isisd/isis_pdu.c @@ -1485,11 +1485,17 @@ int isis_handle_pdu(struct isis_circuit *circuit, uint8_t *ssnpa) case L1_LAN_HELLO: case L2_LAN_HELLO: case P2P_HELLO: + if (fabricd && pdu_type != P2P_HELLO) + return ISIS_ERROR; retval = process_hello(pdu_type, circuit, ssnpa); break; case L1_LINK_STATE: case L2_LINK_STATE: case FS_LINK_STATE: + if (fabricd + && pdu_type != L2_LINK_STATE + && pdu_type != FS_LINK_STATE) + return ISIS_ERROR; retval = process_lsp(pdu_type, circuit, ssnpa, max_area_addrs); break; case L1_COMPLETE_SEQ_NUM: diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index 25e2d43cea..02575a2f6a 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -607,6 +607,9 @@ lspfragloop: for (r = (struct isis_oldstyle_reach *) lsp->tlvs->oldstyle_reach.head; r; r = r->next) { + if (fabricd) + continue; + /* C.2.6 a) */ /* Two way connectivity */ if (!memcmp(r->id, root_sysid, ISIS_SYS_ID_LEN)) @@ -658,6 +661,9 @@ lspfragloop: &lsp->tlvs->oldstyle_ip_reach_ext}; for (unsigned int i = 0; i < array_size(reachs); i++) { + if (fabricd) + continue; + vtype = i ? VTYPE_IPREACH_EXTERNAL : VTYPE_IPREACH_INTERNAL; -- 2.39.5