]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospfd: Get route-map name for default-information originate
authorDonatas Abraitis <donatas@opensourcerouting.org>
Mon, 7 Nov 2022 20:23:07 +0000 (22:23 +0200)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Mon, 7 Nov 2022 20:23:07 +0000 (22:23 +0200)
LR1.wue3(config)# route-map foo-bar-baz10 permit 10
LR1.wue3(config-route-map)# exit
LR1.wue3(config)# router ospf
LR1.wue3(config-router)#  ospf router-id 172.18.254.201
LR1.wue3(config-router)#  log-adjacency-changes
LR1.wue3(config-router)# default-information originate metric 50 metric-type 1 route-map foo-bar-baz10
LR1.wue3(config-router)# end

Results in:

LR1.wue3# show run
...
!
router ospf
 ospf router-id 172.18.254.201
 log-adjacency-changes
 default-information originate metric 50 metric-type 1 route-map oute-map
exit
!
route-map foo-bar-baz10 permit 10
exit
!
end

Let's fix this.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
ospfd/ospf_vty.c

index 52a8dde1b57c382906ec1af6a621b19a018eb782..0bab045ef43b9339fd9f071abc43867534a3f5dd 100644 (file)
@@ -9411,7 +9411,7 @@ DEFUN (ospf_default_information_originate,
        idx = 1;
        /* Get route-map */
        if (argv_find(argv, argc, "route-map", &idx))
-               rtmap = argv[idx]->arg + 1;
+               rtmap = argv[idx + 1]->arg;
 
        /* To check if user is providing same route map */
        if ((!rtmap && !ROUTEMAP_NAME(red)) ||