summaryrefslogtreecommitdiffstats
path: root/pathd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* build: first header *must* be zebra.h or config.hDavid Lamparter2022-04-041-2/+2
| | | | | | | | This has already been a requirement for Solaris, it is still a requirement for some of the autoconf feature checks to work correctly, and it will be a requirement for `-fms-extensions`. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: Fix spelling of wetherDonald Sharp2022-04-021-1/+1
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Fix spelling of FollowingDonald Sharp2022-04-011-1/+1
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* isisd, lib, ospfd, pathd: Null out free'd pointerDonald Sharp2022-03-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commands: router isis 1 mpls-te on no mpls-te on mpls-te on no mpls-te on ! Will crash Valgrind gives us this: ==652336== Invalid read of size 8 ==652336== at 0x49AB25C: typed_rb_min (typerb.c:495) ==652336== by 0x4943B54: vertices_const_first (link_state.h:424) ==652336== by 0x493DCE4: vertices_first (link_state.h:424) ==652336== by 0x493DADC: ls_ted_del_all (link_state.c:1010) ==652336== by 0x47E77B: isis_instance_mpls_te_destroy (isis_nb_config.c:1871) ==652336== by 0x495BE20: nb_callback_destroy (northbound.c:1131) ==652336== by 0x495B5AC: nb_callback_configuration (northbound.c:1356) ==652336== by 0x4958127: nb_transaction_process (northbound.c:1473) ==652336== by 0x4958275: nb_candidate_commit_apply (northbound.c:906) ==652336== by 0x49585B8: nb_candidate_commit (northbound.c:938) ==652336== by 0x495CE4A: nb_cli_classic_commit (northbound_cli.c:64) ==652336== by 0x495D6C5: nb_cli_apply_changes_internal (northbound_cli.c:250) ==652336== Address 0x6f928e0 is 272 bytes inside a block of size 320 free'd ==652336== at 0x48399AB: free (vg_replace_malloc.c:538) ==652336== by 0x494BA30: qfree (memory.c:141) ==652336== by 0x493D99D: ls_ted_del (link_state.c:997) ==652336== by 0x493DC20: ls_ted_del_all (link_state.c:1018) ==652336== by 0x47E77B: isis_instance_mpls_te_destroy (isis_nb_config.c:1871) ==652336== by 0x495BE20: nb_callback_destroy (northbound.c:1131) ==652336== by 0x495B5AC: nb_callback_configuration (northbound.c:1356) ==652336== by 0x4958127: nb_transaction_process (northbound.c:1473) ==652336== by 0x4958275: nb_candidate_commit_apply (northbound.c:906) ==652336== by 0x49585B8: nb_candidate_commit (northbound.c:938) ==652336== by 0x495CE4A: nb_cli_classic_commit (northbound_cli.c:64) ==652336== by 0x495D6C5: nb_cli_apply_changes_internal (northbound_cli.c:250) ==652336== Block was alloc'd at ==652336== at 0x483AB65: calloc (vg_replace_malloc.c:760) ==652336== by 0x494B6F8: qcalloc (memory.c:116) ==652336== by 0x493D7D2: ls_ted_new (link_state.c:967) ==652336== by 0x47E4DD: isis_instance_mpls_te_create (isis_nb_config.c:1832) ==652336== by 0x495BB29: nb_callback_create (northbound.c:1034) ==652336== by 0x495B547: nb_callback_configuration (northbound.c:1348) ==652336== by 0x4958127: nb_transaction_process (northbound.c:1473) ==652336== by 0x4958275: nb_candidate_commit_apply (northbound.c:906) ==652336== by 0x49585B8: nb_candidate_commit (northbound.c:938) ==652336== by 0x495CE4A: nb_cli_classic_commit (northbound_cli.c:64) ==652336== by 0x495D6C5: nb_cli_apply_changes_internal (northbound_cli.c:250) ==652336== by 0x495D23E: nb_cli_apply_changes (northbound_cli.c:268) Let's null out the pointer. After this change. Valgrind no longer reports issues and isisd no longer crashes. Fixes: #10939 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* pathd: bad order of nai adjacencies for ipv6Philippe Guibert2022-03-231-1/+1
| | | | | | | | The order of nai adjacencies ipv6 addresses was wrong. The src and the destination addresses were swapped. Change it. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* *: Change thread->func to return void instead of intDonald Sharp2022-02-245-64/+46
| | | | | | | The int return value is never used. Modify the code base to just return a void instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* pathd: Fix spelling mistakesDonald Sharp2022-02-143-5/+5
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* pathd: fix typo in pathd/path_ted.cYamato Sugawara2021-12-191-1/+1
| | | | Signed-off-by: Yamato Sugawara <yamato.sugawara@linecorp.com>
* *: Remove redundand braces for single statement blocksDonatas Abraitis2021-11-271-2/+1
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* pathd: Convert vty_out to vty_json for JSONDonatas Abraitis2021-11-251-4/+1
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* Merge pull request #10036 from donaldsharp/finally_frrJafar Al-Gharaibeh2021-11-131-1/+1
|\ | | | | Finally frr
| * *: Convert quagga_signal_X to frr_signal_XDonald Sharp2021-11-111-1/+1
| | | | | | | | | | | | | | Naming functions/data structures more appropriately for the project we are actually in. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | *: use compiler.h MIN/MAX macros instead of everyone having oneDonald Sharp2021-11-111-9/+1
|/ | | | | | | | We had various forms of min/max macros across multiple daemons all of which duplicated what we have in compiler.h. Convert everyone to use the `correct` ones Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #9854 from opensourcerouting/zapi-call-tableRuss White2021-10-261-5/+9
|\ | | | | *: convert zclient callbacks to table
| * *: convert zclient callbacks to tableDavid Lamparter2021-10-201-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | This removes a giant `switch { }` block from lib/zclient.c and harmonizes all zclient callback function types to be the same (some had a subset of the args, some had a void return, now they all have ZAPI_CALLBACK_ARGS and int return.) Apart from getting rid of the giant switch, this is a minor security benefit since the function pointers are now in a `const` array, so they can't be overwritten by e.g. heap overflows for code execution anymore. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | Merge pull request #9824 from idryzhov/nb-cli-const-lyd-nodeDonald Sharp2021-10-252-20/+24
|\ \ | | | | | | lib: northbound cli show/cmd functions must not modify data nodes
| * | lib: northbound cli show/cmd functions must not modify data nodesIgor Ryzhov2021-10-132-20/+24
| |/ | | | | | | | | | | | | | | To ensure this, add a const modifier to functions' arguments. Would be great do this initially and avoid this large code change, but better late than never. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* / pathd: Call frr_fini() before exitDonald Sharp2021-10-201-0/+2
|/ | | | | | | | pathd was never calling frr_fini and as such the proper shutdown was not happening for libfrr. This includes logging. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* pathd: Ensure node_src_id is inited before usageDonald Sharp2021-09-091-0/+9
| | | | | | | Compiler is warning that node_src_id may be used uninited we know this is not possible but the compiler doesn't. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: fix for -Wstrict-prototypesDavid Lamparter2021-09-021-1/+1
| | | | | | Just some "void" missing between empty braces. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge pull request #9331 from idryzhov/explicit-exitChristian Hopps2021-08-265-26/+48
|\ | | | | *: explicitly print "exit" at the end of every node config
| * *: explicitly print "exit" at the end of every node configIgor Ryzhov2021-08-234-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a possibility that the same line can be matched as a command in some node and its parent node. In this case, when reading the config, this line is always executed as a command of the child node. For example, with the following config: ``` router ospf network 193.168.0.0/16 area 0 ! mpls ldp discovery hello interval 111 ! ``` Line `mpls ldp` is processed as command `mpls ldp-sync` inside the `router ospf` node. This leads to a complete loss of `mpls ldp` node configuration. To eliminate this issue and all possible similar issues, let's print an explicit "exit" at the end of every node config. This commit also changes indentation for a couple of existing exit commands so that all existing commands are on the same level as their corresponding node-entering commands. Fixes #9206. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| * pathd: rework config printing codeIgor Ryzhov2021-08-233-25/+11
| | | | | | | | | | | | | | | | Instead of setting a config_write callback for each node, set a single callback and print all config from there. It is necessary for the following work on explicit "exit" command in every node. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | *: Drop `break` after using frr_help_exit() in switch/caseDonatas Abraitis2021-08-251-1/+0
|/ | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* vtysh, pathd: fix pcep node-entering commandsIgor Ryzhov2021-08-111-12/+33
| | | | | | | | | | | pce-config, pce and pcc node-entering commands in vtysh include no-form, which is incorrect. Currently, when user passes a no-form command like `no pcc`, vtysh enters the node while pathd deletes the node and this leads to a desynchronization. Regular and no-form commands should be defined separately to fix this. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* pathd: fix indentation and redundant space in index configIgor Ryzhov2021-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | Before: ``` segment-routing traffic-eng segment-list SL1 index 10 mpls label 16010 ``` After: ``` segment-routing traffic-eng segment-list SL1 index 10 mpls label 16010 ``` Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* pathd: fix indentation for mpls-te configIgor Ryzhov2021-08-051-4/+4
| | | | | | | | | | | | | | | | | | | | Before: ``` segment-routing traffic-eng mpls-te on mpls-te import ospfv2 ``` After: ``` segment-routing traffic-eng mpls-te on mpls-te import ospfv2 ``` Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* Merge pull request #9102 from opensourcerouting/autoconf-fix-gcovDonald Sharp2021-07-221-1/+1
|\ | | | | build: fix LDFLAGS confusion & gcov
| * build: fix `AM_LDFLAGS` usage (and gcov)David Lamparter2021-07-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | like the other automake variables, setting `xyz_LDFLAGS` causes `AM_LDFLAGS` to be ignored for `xyz`. For some reason I had in my mind that automake doesn't do this for LDFLAGS, but... it does. (Which is consistent with `_CFLAGS` and co.) So, all the libraries and modules have been ignoring `AM_LDFLAGS` (which includes `SAN_FLAGS` too). Set up new `LIB_LDFLAGS` and `MODULE_LDFLAGS` to handle all of this correctly (and move these bits to a central location.) Fixes: #9034 Fixes: 0c4285d77eb ("build: properly split CFLAGS from AC_CFLAGS") Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | pathd: don't use localtimeMark Stapp2021-07-201-3/+3
|/ | | | | | Use localtime_r() instead of localtime() in pathd. Signed-off-by: Mark Stapp <mjs.ietf@gmail.com>
* Merge pull request #8938 from volta-networks/fix_no_path_retriesDonald Sharp2021-07-062-2/+53
|\ | | | | pathd : Better RFC complain for two cases, no_path answer and srp_id handle
| * pathd: Handle srp_id correctly (2/2)Javier Garcia2021-06-282-1/+2
| | | | | | | | | | | | | | | | Based on RFC 8231 #5.8.3 PcUpd RFC 8181 #5.1 Pcinit Signed-off-by: Javier Garcia <javier.garcia@voltanet.io>
| * pathd: If pce ret no-path to PcReq don't retry PcReq nor delegate(1/2)Javier Garcia2021-06-241-1/+51
| | | | | | | | | | | | | | | | | | | | Based in RFC 5440 @4.2.2 ""...after a no-path , the pcc may decide" and RFC 8231 #5.8.3 "... pcc must not set PcReq after path is delegated" So will not (try) to delegate the path with no-path neither must do further retries. Signed-off-by: Javier Garcia <javier.garcia@voltanet.io>
* | pathd: coverity msg , frr_weak_random instead rand.Javier Garcia2021-06-251-1/+1
|/ | | | Signed-off-by: Javier Garcia <javier.garcia@voltanet.io>
* pathd: Sanity checks. (4/4)Javier Garcia2021-06-221-1/+23
| | | | | Co-authored-by: Javier Garcia <javier.garcia@voltanet.io> Signed-off-by: Sebastien Merle <sebastien@netdef.org>
* pathd: Handle PCInitiated configuration, main thread. (3/4)Javier Garcia2021-06-229-18/+216
| | | | | Co-authored-by: Javier Garcia <javier.garcia@voltanet.io> Signed-off-by: Sebastien Merle <sebastien@netdef.org>
* pathd: Handle PCInitiated messages, thread controller. (2/4)Javier Garcia2021-06-227-26/+288
| | | | | | Co-authored-by: Javier Garcia <javier.garcia@voltanet.io> Signed-off-by: Sebastien Merle <sebastien@netdef.org> Signed-off-by: Javier Garcia <javier.garcia@voltanet.io>
* pathd: Remove unused functionDonald Sharp2021-06-052-13/+0
| | | | | | format_yang_dnode is never used and it has coverity issues, removing Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* pathd: fix render candidate-path bandwidthEmanuele Di Pascale2021-06-011-2/+3
| | | | | | | | | the config for dynamic candidate paths with bandwidth preferences was using a different order of keywords (required bandwidth X) than the corresponding command (bandwidth X required). This confuses frr-reload, and possibly users too. Make both use the same order. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
* Merge pull request #8665 from volta-networks/fix_pathd_coverityOlivier Dugeon2021-05-193-8/+7
|\ | | | | pathd: Clean coverity issues after merge pathd link state feature.
| * pathd: Clean coverity issues after merge pathd link state feature.Javier Garcia2021-05-183-8/+7
| | | | | | | | Signed-off-by: Javier Garcia <javier.garcia@voltanet.io>
* | Merge pull request #8667 from volta-networks/fix_pathd_cli_affinityOlivier Dugeon2021-05-191-6/+4
|\ \ | | | | | | pathd: Fix affinity command to exclude options to match implementation.
| * | pathd: Fix affinity command to exclude options to match implementation.Javier Garcia2021-05-181-6/+4
| |/ | | | | | | | | | | Including documentation update. Signed-off-by: Javier Garcia <javier.garcia@voltanet.io>
* / lib: adapt to version 2 of libyangChristian Hopps2021-05-131-1/+1
|/ | | | | | | | | Compile with v2.0.0 tag of `libyang2` branch of: https://github.com/CESNET/libyang staticd init load time of 10k routes now 6s vs ly1 time of 150s Signed-off-by: Christian Hopps <chopps@labn.net>
* pathd. TED support . Validation of candidate path - [part 2/4]Javier Garcia2021-05-107-82/+685
| | | | | | | | | | | | | | - Explicit segment list nai will be resolved to corresponded sid. - Dynamic segment list (from pce) will be validated. - If segment list could not be resolved or validated won't be used. - Now this new config is supported segment-list sl-1 index 10 nai prefix 10.1.2.1/32 iface 1 index 30 nai adjacency 10.2.5.2 10.2.5.5 index 40 nai prefix 10.10.10.5/32 algorithm 0 Signed-off-by: Javier Garcia <javier.garcia@voltanet.io>
* pathd. TED support . Client to link State - [part 1/4]Javier Garcia2021-05-107-2/+987
| | | | | | | | | | | | | - pathd will act as a client to for the configured igp. - pathd must be configured to activate and receive data from igp. !pathd config snippet segment-routing traffic-eng mpls-te on mpls-te import ospfv2 Signed-off-by: Javier Garcia <javier.garcia@voltanet.io>
* Merge pull request #8545 from opensourcerouting/assert-our-ownMark Stapp2021-05-035-0/+10
|\ | | | | *: make our own assert() actually work
| * *: make sure `config.h` or `zebra.h` is firstDavid Lamparter2021-04-235-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | `config.h` has all the defines from autoconf, which may include things that switch behavior of other included headers (e.g. _GNU_SOURCE enabling prototypes for additional functions.) So, the first include in any `.c` file must be either `config.h` (with the appropriate guard) or `zebra.h` (which includes `config.h` first thing.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | pathd: don't init PCEP before fork()David Lamparter2021-04-221-1/+11
|/ | | | | | | | Turns out the PCEP stuff does not work particularly well if its threads are ... missing. Who would've thought? Reported-by: Erik Kooistra <me@erikkooistra.nl> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* build: properly split CFLAGS from AC_CFLAGSDavid Lamparter2021-04-211-1/+1
| | | | | | | | `CFLAGS` is a "user variable", not intended to be controlled by configure itself. Let's put all the "important" stuff in AC_CFLAGS and only leave debug/optimization controls in CFLAGS. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>