summaryrefslogtreecommitdiff
path: root/bgpd/rfapi/bgp_rfapi_cfg.c
AgeCommit message (Collapse)Author
2020-04-20*: sprintf -> snprintfQuentin Young
Replace sprintf with snprintf where straightforward to do so. - sprintf's into local scope buffers of known size are replaced with the equivalent snprintf call - snprintf's into local scope buffers of known size that use the buffer size expression now use sizeof(buffer) - sprintf(buf + strlen(buf), ...) replaced with snprintf() into temp buffer followed by strlcat Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-16*: move CLI node names to cmd_node->nameDavid Lamparter
And again for the name. Why on earth would we centralize this, just so people can forget to update it? Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: move CLI parent data to cmd_node->parent_nodeDavid Lamparter
Same as before, instead of shoving this into a big central list we can just put the parent node in cmd_node. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: remove second parameter on install_node()David Lamparter
There is really no reason to not put this in the cmd_node. And while we're add it, rename from pointless ".func" to ".config_write". [v2: fix forgotten ldpd config_write] Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: remove cmd_node->vtyshDavid Lamparter
The only nodes that have this as 0 don't have a "->func" anyway, so the entire thing is really just pointless. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: clean up cmd_node initializersDavid Lamparter
... and use named assignments everywhere (so I can change the struct.) Signed-off-by: David Lamparter <equinox@diac24.net>
2020-03-10treewide: fix some issues found with -Werror=undefRuben Kerkhof
Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2019-05-10bgpd, lib, ospf6d, ospfd, pimd, zebra: Rework routemap event callbackDonald Sharp
The route_map_event_hook callback was passing the `route_map_event_t` to each individual interested party. No-one is ever using this data so let's cut to the chase a bit and remove the pass through of data. This is considered ok in that the routemap.c code came this way originally and after 15+ years no-one is using this functionality. Nor do I see any `easy` way to do anything useful with this data. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-25*: remove casts of XMALLOC / XCALLOCQuentin Young
No cast necessary for void * Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25*: remove null check before XFREEQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-12bgpd: remove route-map decrement call on prefix-listMark Stapp
Commit b4897fa5 introduced a call to decrement a route-map counter, applied to a prefix-list in bgp_rfapi_cfg.c. This commit removes that call. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-02-04bgpd: Added changes to track route-map usagergirada
Made changes and updated the routemap applied counter in the following flows. 1.Increment when route map attached to a list. 2.Decrement when route map removed / modified from a  list. 3.Increment/decrement when route map create/delete callback triggered. 4.Besides ,This counter need not be updated when a route map is got updated. i.e changing/adding a match value to the existing routemap. In BGP , same update api called for all three add/delete/update operation . But this counter have to be updated only for routemap addition. Addressed this specific change by identifying the routemap operation based on routemap pointer. Signed-off-by: RajeshGirada <rgirada@vmware.com>
2019-01-24Treewide: use ANSI function definitionsRuben Kerkhof
Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2018-10-20bgpd: fix crashes caused by missing input validationRenato Westphal
The rfapi code wasn't checking if strtoul() succeeded or not when parsing the list of labels. Fix the affected commands by not allowing the user to enter a non-numeric input. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-10-20bgpd: fix some NULL pointer dereference bugsRenato Westphal
Other parts of the rfapi code also check if these pointers are NULL or not before using them. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-10-02*: list_delete_and_null() -> list_delete()David Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-09-13bgpd lib ospf6d pbrd tests zebra: shadowing fixesF. Aragon
This fixes all remaining local variable shadowing cases Signed-off-by: F. Aragon <paco@voltanet.io>
2018-08-30bgpd, ripngd: Convert to using new agg_table/routeDonald Sharp
Switch bgp and ripngd to use the new aggregate table and route data structures. This was mainly a search and replace operation. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-28bgpd: copy-paste error (Coverity 1399219)paco
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-20bgpd ospf6d: null check (Coverity 1221453 1461297)paco
2018-06-15bgpd: out-of-bounds access (Coverity 1399306)paco
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-13bgpd: dead code removal (Coverity 1399389)paco
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-04-13bgpd: rfapi xcallocs guaranteed non-nullQuentin Young
The return value of XCALLOC will always be non-null. Even if it were to be null, this code would still crash with a NPD. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-09bgpd: vpn-vrf route leakingG. Paul Ziemba
- add "debug bgp vpn label" CLI - improved debug messages for "debug bgp bestpath" - send vrf label to zebra after zebra informs bgpd of vrf_id - withdraw vrf_label from zebra if zebra informs bgpd that vrf_id is disabled Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-03-06*: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2018-02-16bgpd: prevent from configuring vrf-policy when in BGP VRF instancePhilippe Guibert
Under a BGP VRF instance, prevent from entering in vrf-policy mode. This mode is reserved for non VRF instances that want to handle several VRF at the same time. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-02-13Merge pull request #1701 from donaldsharp/zapi_vrf_labelMartin Winter
Zapi vrf label
2018-02-09bgpd: ran indent.py on some files prior to bgp vpn-vrf leaking changesG. Paul Ziemba
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-02-08bgpd, lib, sharpd, zebra: Use MPLS_LABEL_NONEDonald Sharp
Modify mpls.h to rename MPLS_LABEL_ILLEGAL to be MPLS_LABEL_NONE. Fix all pre-existing code that used MPLS_LABEL_ILLEGAL. Modify the zapi vrf label message to use MPLS_LABEL_NONE as the signal to remove label associated with a vrf. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-11bgp: don't show vnc response-lifetime config line when set to default valueLou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2017-12-14bgpd: handle argv_find_and_parse_afi return valueRafael Zalamena
Handle the return value of argv_find_and_parse_afi() to avoid passing along bad values. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2017-12-11bgpd: Fixup buffer sizes for prefix_rd2strDonald Sharp
The prefix_rd2str uses a buffer size of RD_ADDRSTRLEN. Modify the code to consistently use this for all of BGP. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-12-11bgpd: Fix prefix2str using BUFSIZ to PREFIX_STRLENDonald Sharp
PREFIX_STRLEN is the correct length for buffers needed to output a prefix2str. Additionally cleanup some setting of the last value to a `\0` this is handled by prefix2str. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-07bgpd: fun with whitespace conventionsLou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2017-11-07bgpd: rfapi - fix error outputLou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2017-11-07bgpd: rfapi - open rfd for vrf groups on export config,Lou Berger
keep open until group deleted Signed-off-by: Lou Berger <lberger@labn.net>
2017-10-31bgpd: rfapi support import based on vrf-policy (precusor to import to vrf ↵Lou Berger
instance) Signed-off-by: Lou Berger <lberger@labn.net>
2017-10-31bgpd: vrf-policy add prefix lists and route-maps on exportLou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2017-10-09rfapi: block vnc commands on vrfs/viewsLou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2017-10-05*: Convert list_delete(struct list *) to ** to allow nullingDonald Sharp
Convert the list_delete(struct list *) function to use struct list **. This is to allow the list pointer to be nulled. I keep running into uses of this list_delete function where we forget to set the returned pointer to NULL and attempt to use it and then experience a crash, usually after the developer has long since left the building. Let's make the api explicit in it setting the list pointer to null. Cynical Prediction: This code will expose a attempt to use the NULL'ed list pointer in some obscure bit of code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-27Merge pull request #1180 from dwalton76/ipv6-static-route-null0Renato Westphal
Ipv6 static route null0
2017-09-19bgpd: rfapi - fix a couple of check that should have been against RD len vs ↵Lou Berger
RD type flag (family) Signed-off-by: Lou Berger <lberger@labn.net>
2017-09-14*: support keywords that begin with uppercase letterDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> VARIABLE tokens must be all uppercase, this allows us to support WORD tokens that begin with an uppercase letter. The "Null0" keyword is an example of where this is needed. The only VARIABLE we had that wasn't already all uppercase was ASN:nn_or_IP-address:nn
2017-09-02bgpd: rfapi - fix vestige from gratuitous grammar change.Lou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2017-08-24*: fix assorted issues detected by Coverity ScanRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-27bgpd rfapi: use afi_tLou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2017-07-27bgp rfapi: use route_table_init and _finish (fixes crash due to recent lib ↵Lou Berger
change) Signed-off-by: Lou Berger <lberger@labn.net>
2017-07-22Revert "*: reindent pt. 2"David Lamparter
This reverts commit c14777c6bfd0a446c85243d3a9835054a259c276. clang 5 is not widely available enough for people to indent with. This is particularly problematic when rebasing/adjusting branches. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-17*: reindent pt. 2whitespace / reindent
w/ clang 5 * reflow comments * struct members go 1 per line * binpack algo was adjusted
2017-07-17*: reindentreindent-master-afterwhitespace / reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>