diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2018-10-19 20:55:47 +0200 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2018-10-20 17:39:05 +0200 |
commit | 98c06e8618fe7c73edddeaf6ac35186521e4604b (patch) | |
tree | 733399348619641790d9534b8d34328beaa98e17 /ospfd/ospf_sr.c | |
parent | ospf6d: fix two "show" commands (diff) | |
download | frr-98c06e8618fe7c73edddeaf6ac35186521e4604b.tar.xz frr-98c06e8618fe7c73edddeaf6ac35186521e4604b.zip |
ospfd: fix issue with the "no segment-routing prefix A.B.C.D/M" command
Add a missing check to bail out earlier when SR is not configured. The
same command without the "no" prefix has the same check as it prevents
unexpected things (i.e. crashes) from happening.
Fixes the following segfaults:
ospfd aborted: vtysh -c "configure terminal" -c "router ospf" -c "no segment-routing prefix 1.1.1.1/32"
ospfd aborted: vtysh -c "configure terminal" -c "router ospf" -c "no segment-routing prefix 1.1.1.1/32 index 65535 no-php-flag"
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ospfd/ospf_sr.c')
-rw-r--r-- | ospfd/ospf_sr.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ospfd/ospf_sr.c b/ospfd/ospf_sr.c index d79373500..3a21b723d 100644 --- a/ospfd/ospf_sr.c +++ b/ospfd/ospf_sr.c @@ -2053,6 +2053,9 @@ DEFUN (no_sr_prefix_sid, bool found = false; int rc; + if (!ospf_sr_enabled(vty)) + return CMD_WARNING_CONFIG_FAILED; + /* Get network prefix */ argv_find(argv, argc, "A.B.C.D/M", &idx); rc = str2prefix(argv[idx]->arg, &p); |