]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: Get route-map name for default-information originate 12277/head
authorDonatas Abraitis <donatas@opensourcerouting.org>
Mon, 7 Nov 2022 20:23:07 +0000 (22:23 +0200)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Tue, 8 Nov 2022 04:09:01 +0000 (04:09 +0000)
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>
(cherry picked from commit bd162aae094360605b7f4b9b8cd46f6e4ffebc04)

ospfd/ospf_vty.c

index c957c8c014e0757e89b9b396b2a9ed35590270a7..b9f154ad039ca6971b51c0730a0ca003ae315d6e 100644 (file)
@@ -9412,7 +9412,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)) ||