diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2016-08-11 16:59:08 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2016-08-16 16:05:42 +0200 |
commit | 9af6011992d8012ca146343be49a8e3df4da3885 (patch) | |
tree | 2c6cc844ec942a3b79d93180ed7f21617c264b83 /isisd | |
parent | lib: don't have log functions change errno (diff) | |
download | frr-9af6011992d8012ca146343be49a8e3df4da3885.tar.xz frr-9af6011992d8012ca146343be49a8e3df4da3885.zip |
isisd: fix isis_circuit_create()
Between the awkwardly managed CSM and the tacked-on IPv6 support, the
simplified logic to setup a circuit wasn't quite right.
Note that the API essentially allows creating a circuit without enabling
either IPv4 or IPv6. This wasn't possible before and probably breaks
isisd in 'interesting' ways. The CLI won't do this, so it's only an
issue when adding on other configuration mechanisms.
Reported-by: Martin Winter <mwinter@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'isisd')
-rw-r--r-- | isisd/isis_circuit.c | 6 | ||||
-rw-r--r-- | isisd/isis_vty.c | 16 |
2 files changed, 10 insertions, 12 deletions
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c index d8ca694d5..b9ebf5250 100644 --- a/isisd/isis_circuit.c +++ b/isisd/isis_circuit.c @@ -1226,8 +1226,10 @@ isis_interface_config_write (struct vty *vty) struct isis_circuit * isis_circuit_create (struct isis_area *area, struct interface *ifp) { - struct isis_circuit *circuit; - circuit = isis_csm_state_change (ISIS_ENABLE, NULL, area); + struct isis_circuit *circuit = circuit_scan_by_ifp (ifp); + if (circuit && circuit->area) + return NULL; + circuit = isis_csm_state_change (ISIS_ENABLE, circuit, area); assert (circuit->state == C_STATE_CONF || circuit->state == C_STATE_UP); isis_circuit_if_bind (circuit, ifp); return circuit; diff --git a/isisd/isis_vty.c b/isisd/isis_vty.c index 3f218561c..3ce06b83d 100644 --- a/isisd/isis_vty.c +++ b/isisd/isis_vty.c @@ -72,17 +72,13 @@ DEFUN (ip_router_isis, /* Prevent more than one area per circuit */ circuit = circuit_scan_by_ifp (ifp); - if (circuit) + if (circuit && circuit->area) { - if (circuit->ip_router == 1) + if (strcmp (circuit->area->area_tag, area_tag)) { - if (strcmp (circuit->area->area_tag, area_tag)) - { - vty_out (vty, "ISIS circuit is already defined on %s%s", - circuit->area->area_tag, VTY_NEWLINE); - return CMD_ERR_NOTHING_TODO; - } - return CMD_SUCCESS; + vty_out (vty, "ISIS circuit is already defined on %s%s", + circuit->area->area_tag, VTY_NEWLINE); + return CMD_ERR_NOTHING_TODO; } } @@ -90,7 +86,7 @@ DEFUN (ip_router_isis, if (!area) area = isis_area_create (area_tag); - if (!circuit) + if (!circuit || !circuit->area) circuit = isis_circuit_create (area, ifp); bool ip = circuit->ip_router, ipv6 = circuit->ipv6_router; |