From: Lu Feng Date: Thu, 8 Jan 2015 01:21:02 +0000 (+0000) Subject: isisd: fix crash on changing the circuit type of a passive interface X-Git-Tag: frr-2.0-rc1~770 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=11432acdde160a1dfe9b7e1dde6e7b17d6891d72;p=mirror%2Ffrr.git isisd: fix crash on changing the circuit type of a passive interface Signed-off-by: Feng Lu Signed-off-by: David Lamparter (cherry picked from commit 92cff4f7cd7e805e6689e73e63029aaccd145eca) --- diff --git a/isisd/isis_events.c b/isisd/isis_events.c index 79e5ab379d..0dee9e6f52 100644 --- a/isisd/isis_events.c +++ b/isisd/isis_events.c @@ -284,26 +284,29 @@ isis_event_circuit_type_change (struct isis_circuit *circuit, int newtype) return; } - switch (circuit->is_type) + if (! circuit->is_passive) { - case IS_LEVEL_1: - if (newtype == IS_LEVEL_2) - circuit_resign_level (circuit, 1); - circuit_commence_level (circuit, 2); - break; - case IS_LEVEL_1_AND_2: - if (newtype == IS_LEVEL_1) - circuit_resign_level (circuit, 2); - else - circuit_resign_level (circuit, 1); - break; - case IS_LEVEL_2: - if (newtype == IS_LEVEL_1) - circuit_resign_level (circuit, 2); - circuit_commence_level (circuit, 1); - break; - default: - break; + switch (circuit->is_type) + { + case IS_LEVEL_1: + if (newtype == IS_LEVEL_2) + circuit_resign_level (circuit, 1); + circuit_commence_level (circuit, 2); + break; + case IS_LEVEL_1_AND_2: + if (newtype == IS_LEVEL_1) + circuit_resign_level (circuit, 2); + else + circuit_resign_level (circuit, 1); + break; + case IS_LEVEL_2: + if (newtype == IS_LEVEL_1) + circuit_resign_level (circuit, 2); + circuit_commence_level (circuit, 1); + break; + default: + break; + } } circuit->is_type = newtype;