summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorYuxiang Zhu <vfreex@gmail.com>2022-12-27 17:47:56 +0800
committerYuxiang Zhu <vfreex@gmail.com>2022-12-27 18:03:10 +0800
commitea802233e3da193a689b1690cc9026fd927cb6fa (patch)
tree7e0d98202ee56700bc10e246096695729dcb7a44 /templates
parentd13fe84487444c8a71fbbb7623ae81b6a2edb83d (diff)
downloadvyatta-cfg-quagga-ea802233e3da193a689b1690cc9026fd927cb6fa.tar.gz
vyatta-cfg-quagga-ea802233e3da193a689b1690cc9026fd927cb6fa.zip
T4896: ospfv3: Fix broken not-advertise option
Config option `protocols ospfv3 area <number> range <prefix> not-advertise` is broken and behaves exactly same as `advertise`. Steps to reproduce: ``` set protocols ospfv3 area 16 range 2000::/4 not-advertise ``` Actual result: ``` $ vtysh -c 'show run' ! router ospf6 area 16 range 2000::/4 ``` Expected result: ``` $ vtysh -c 'show run' ! router ospf6 area 16 range 2000::/4 not-advertise ``` It seems to me that `templates/protocols/ospfv3/area/node.tag/range/node.def` overwrites `area $AREA range $RANGE` even if child node `no-advertise` is set. It seems to me the scripts in that file is used to make child option `advertise` optional. This PR changes it to only run when children options (advertise, not-advertise) are not set.
Diffstat (limited to 'templates')
-rw-r--r--templates/protocols/ospfv3/area/node.tag/range/node.def25
1 files changed, 10 insertions, 15 deletions
diff --git a/templates/protocols/ospfv3/area/node.tag/range/node.def b/templates/protocols/ospfv3/area/node.tag/range/node.def
index de886a72..83d0dc1f 100644
--- a/templates/protocols/ospfv3/area/node.tag/range/node.def
+++ b/templates/protocols/ospfv3/area/node.tag/range/node.def
@@ -3,18 +3,13 @@ type: ipv6net
help: Specify IPv6 prefix (border routers only)
syntax:expression: exec "ipaddrcheck --verbose --is-ipv6-net $VAR(@)"
-delete: touch /tmp/ospf6-range.$PPID
-
-end: if [ -f /tmp/ospf6-range.$PPID ]; then
- vtysh -c "configure terminal" \
- -c "router ospf6" \
- -c "no area $VAR(../@) range $VAR(@)";
- rm /tmp/ospf6-range.$PPID;
- else
- vtysh --noerror -c "configure terminal" \
- -c "router ospf6" \
- -c "no area $VAR(../@) range $VAR(@)";
- vtysh -c "configure terminal" \
- -c "router ospf6" \
- -c "area $VAR(../@) range $VAR(@)";
- fi;
+create: if [ -z $VAR(./not-advertise/@) ] && [ -z $VAR(./advertise/@) ]; then
+ vtysh -c "configure terminal" \
+ -c "router ospf6" \
+ -c "area $VAR(../@) range $VAR(@)"; \
+ fi;
+delete: if [ -z $VAR(./not-advertise/@) ] && [ -z $VAR(./advertise/@) ]; then
+ vtysh -c "configure terminal" \
+ -c "router ospf6" \
+ -c "no area $VAR(../@) range $VAR(@)"; \
+ fi;