summaryrefslogtreecommitdiffstats
path: root/zebra/rtadv.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* zebra: use MTYPE_STATICDavid Lamparter2019-06-211-0/+2
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: keep rtadv_sock field in zrouter for optimisationPhilippe Guibert2019-06-041-9/+25
| | | | | | | | | in the case the vrf backend is vrf-lite, there is no need to have separate sockets. use a socket located in zrouter, so that when needing the socket, a common API is used. that API will return the appropriate socket value. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* zebra: move rtadv service from zrouter to zvrfPhilippe Guibert2019-06-041-57/+62
| | | | | | | | | when network namespace is used as vrf backend, there is need to have separate contexts for rtadv contexts. route advertisements have to look for appropriate interface based on zvrf context. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* Revert "zebra: move rtadv service from zrouter to zvrf"Donald Sharp2019-05-161-62/+57
| | | | This reverts commit f20e2a09c8aef399698fa074b36f24becdf49cbb.
* Revert "zebra: keep rtadv_sock field in zrouter for optimisation"Donald Sharp2019-05-161-24/+9
| | | | This reverts commit 3738d700ff9aac5b7c4fed1a41dc47644488009f.
* zebra: keep rtadv_sock field in zrouter for optimisationPhilippe Guibert2019-04-251-9/+24
| | | | | | | | | in the case the vrf backend is vrf-lite, there is no need to have separate sockets. use a socket located in zrouter, so that when needing the socket, a common API is used. that API will return the appropriate socket value. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* zebra: move rtadv service from zrouter to zvrfPhilippe Guibert2019-04-251-57/+62
| | | | | | | | | when network namespace is used as vrf backend, there is need to have separate contexts for rtadv contexts. route advertisements have to look for appropriate interface based on zvrf context. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* zebra: Fix CLANG suggestion for braces on init of structStephen Worley2019-02-121-4/+4
| | | | | | | CLANG was throwing an error because struct rtadv_rdnss(dnssl) was being initialized with = {0} instead of {}. Change to be the latter. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
* Merge pull request #3723 from slrz/zebra-rtadv-add-rfc8106-supportDavid Lamparter2019-02-121-0/+406
|\ | | | | zebra: add support for IPv6 RA options for DNS configuration (RFC8106)
| * zebra: prefer DEFINE_MTYPE_STATIC for local memtypesLars Seipel2019-02-111-0/+3
| | | | | | | | Signed-off-by: Lars Seipel <ls@slrz.net>
| * zebra: avoid exceeding link MTU through RA optionsLars Seipel2019-02-021-6/+31
| | | | | | | | Signed-off-by: Lars Seipel <ls@slrz.net>
| * zebra: support DNS configuration options in rtadvLars Seipel2019-02-021-0/+378
| | | | | | | | | | | | | | Add support for the RDNSS and DNSSL router advertisement options described in RFC 8106. Signed-off-by: Lars Seipel <ls@slrz.net>
* | zebra: Move the master thread handler to the zrouter structureDonald Sharp2019-01-311-5/+5
|/ | | | | | | | The master thread handler is really part of the zrouter structure. So let's move it over to that. Eventually zserv.h will only be used for zapi messages. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Move rtadv to zebra_routerDonald Sharp2018-10-241-35/+28
| | | | | | The rtadv setting was not per namespace it is per router. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Trust the mac address received in some situationsDonald Sharp2018-09-191-5/+42
| | | | | | | | | | When we receive a v6 RA packet with an optional ND_OPT_SOURCE_LINKADDR take that data and construct the v4 to v6 neighbor entry for that interface to allow v4 w/ v6 nexthops to work with only global v6 addresses on an interface. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: LIB_[ERR|WARN] -> EC_LIBQuentin Young2018-09-131-4/+4
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: ZEBRA_[ERR|WARN] -> EC_ZEBRAQuentin Young2018-09-131-7/+7
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: fix includesQuentin Young2018-09-061-0/+1
| | | | | | Add and remove error related includes as necessary. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: flog_warn conversionQuentin Young2018-09-061-26/+39
| | | | | | Convert Zebra to user error subsystem. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Merge pull request #2448 from qlyoung/error-reference-cardsDavid Lamparter2018-08-161-12/+10
|\ | | | | Error Reference Cards
| * zebra: fix warnings from frr_elevate_privs()David Lamparter2018-08-141-1/+1
| | | | | | | | Signed-off-by: David Lamparter <equinox@diac24.net>
| * *: use frr_elevate_privs() (1/2: coccinelle)David Lamparter2018-08-141-9/+3
| | | | | | | | Signed-off-by: David Lamparter <equinox@diac24.net>
| * *: rename ferr_zlog -> flog_err_sysQuentin Young2018-08-141-4/+4
| | | | | | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
| * *: rename zlog_fer -> flog_errQuentin Young2018-08-141-3/+3
| | | | | | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
| * zebra, lib: error references for zebraQuentin Young2018-08-141-8/+12
| | | | | | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | lib, ripngd, zebra: Remove pre-solaris 9 special cased codeDonald Sharp2018-08-151-2/+2
|/ | | | | | | | | The CMSG_FIRSTHDR was broken on solaris pre version 9. Version 9 was released in May of 2002 and EOL'ed in 2014. Version 8 EOL'ed in 2012. Remove special case code for a little used platform that has not seen the light of day in a very long time. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* bgpd zebra: element overflow (PVS-Studio)F. Aragon2018-07-021-1/+1
| | | | | | | | The warning given by PVS-Studio is related to per-element overflow (there is no real overflow, because of how elements are mapped in the union). This same warning is typically reported by Coverity, too. Signed-off-by: F. Aragon <paco@voltanet.io>
* zebra: clean up zapi organizationQuentin Young2018-04-231-1/+1
| | | | | | | | | | | | | zserv.c has become something of a dumping ground for everything vaguely related to ZAPI and really needs some love. This change splits out the code fo building and consuming ZAPI messages into a separate source file, leaving the actual session and client lifecycle code in zserv.c. Unfortunately since the #include situation in Zebra has not been paid much attention I was forced to fix the headers in a lot of other source files. This is a net improvement overall though. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Revert "zebra: implement draft-bz-v4goawayflag-00"Quentin Young2018-04-021-22/+0
| | | | | | | | This reverts commit 3fec765a8d986664a555c161b814b4bf3332cdf0. April fools! Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: implement draft-bz-v4goawayflag-00Quentin Young2018-04-011-0/+22
| | | | | | | | | | Adds support for V4 GoAway flag as described in https://www.ietf.org/id/draft-bz-v4goawayflag-00.txt This option allows advertising neighbors to indicate to recipients that they should disable IPv4 on the link. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-8/+8
| | | | | | | | | | | | | | | | | | | | | | The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: reorganize zserv, batch i/oQuentin Young2018-03-121-10/+9
| | | | | | | | Group send and receive functions together, change handlers to take a message instead of looking at ->ibuf and ->obuf, allow zebra to read multiple packets off the wire at a time. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: standardize ZAPI message handler argsQuentin Young2018-03-121-7/+16
| | | | | | | | | | | | A lot of the handler functions that are called directly from the ZAPI input processing code take different argument sets where they don't need to. These functions are called from only one place and all have the same fundamental information available to them to do their work. There is no need to specialize what information is passed to them; it is cleaner and easier to understand when they all accept the same base set of information and extract what they need inline. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger2018-03-061-3/+3
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* zebra: socket operations stick to namespace if necessaryPhilippe Guibert2018-02-271-3/+4
| | | | | | | | | | | | Upon following calls: interface poll, address poll, route poll, and ICMPv6 handling, each new Namespace is being parsed. For that, the socket operations need to switch from one NS to one other, to get the necessary information. As of now, there is a crash when dumping interfaces, through show running-config. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* zebra: do not display ipv6 ra commands created by bgpdDon Slice2017-12-061-13/+33
| | | | | | | | | | | | | | | | | | | | If the frr.conf file contains bgp unnumbered peering but the associated interfaces do not have the commands "no ipv6 nd suppress-ra" and "ipv6 nd ra-interval 10" configured, when frr-reload.py is issued the interface commands are removed from the running config, causing peers to got down and stay down after a link flap. This situation can occur if the frr.conf file is created manually or via automation (like ansible) but a subsequent "wr mem" has not been performed. This fix changes the behavior so that the interface ipv6 nd ra commands created by bgp are not displayed. Therefore, when the above condition occurs, there is no difference between the running and stored configs and peers work fine. Ticket: CM-18702 Signed-off-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: CCR-7004 Testing-done: Manual testing successful. L3-smoke has no new failures
* lib, zebra: Modify zebra to use STREAM_GET for zapiDonald Sharp2017-11-131-3/+5
| | | | | | | | This code modifies zebra to use the STREAM_GET functionality. This will allow zebra to continue functioning in the case of bad input data from higher level protocols instead of crashing. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: fix coverity warnings - resource leaksRenato Westphal2017-10-241-0/+1
| | | | | | | | | | | | | | These are mostly trivial fixes for leaks in the error path of some functions. The changes in bgpd/bgp_mpath.c deserves a bit of explanation though. In the bgp_info_mpath_aggregate_update() function, we were allocating memory for the lcomm variable but doing nothing with it. Since the code for communities, extended communities and large communities is pretty much the same in this function, it's clear that this was a copy and paste error where most of the ext. community code was copied but not all of it as it should have been. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* zebra: No need to pass sock descriptor around.Donald Sharp2017-10-241-1/+1
| | | | | | Standardize the api to read zapi requests from protocols. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: use the FOR_ALL_INTERFACES abstraction from babeldRenato Westphal2017-10-101-1/+1
| | | | | | | | | | This improves code readability and also future-proofs our codebase against new changes in the data structure used to store interfaces. The FOR_ALL_INTERFACES_ADDRESSES macro was also moved to lib/ but for now only babeld is using it. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: use rb-trees to store interfaces instead of sorted linked-listsRenato Westphal2017-10-101-2/+1
| | | | | | | | | | | This is an important optimization for users running FRR on systems with a large number of interfaces (e.g. thousands of tunnels). Red-black trees scale much better than sorted linked-lists and also store the elements in an ordered way (contrary to hash tables). This is a big patch but the interesting bits are all in lib/if.[ch]. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* zebra: Properly initialize memory for rtadvDonald Sharp2017-10-021-2/+4
| | | | | | | | | | The adata pointer was not properly being set to 0 before being used. In addition notice malloc failure and hard exit. If we have no memory on startup something terrible has gone wrong and we were going to crash shortly here anyways. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: use clang's 'ForEachMacros' format style optionRenato Westphal2017-09-151-30/+37
| | | | | | | | | | | | | This fixes the broken indentation of several foreach loops throughout the code. From clang's documentation[1]: ForEachMacros: A vector of macros that should be interpreted as foreach loops instead of as function calls. [1] http://clang.llvm.org/docs/ClangFormatStyleOptions.html Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* zebra: Coverity Code CleanupDonald Sharp2017-08-251-1/+0
| | | | | | | | | | | 1) Various socket close issues 2) Ensure afi passed is usable 3) Fix some reads beyond buffer and reads after free 4) Ensure some failure modes are handled properly 5) Memory Leak(s) fix 6) There is no 6. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: fix assorted issues detected by Coverity ScanRenato Westphal2017-08-251-0/+1
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* zebra: start detangling rtadv & irdpDavid Lamparter2017-08-151-1/+76
| | | | | | | Replace some cross-dependencies with hooks & move bits to where they belong. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Revert "*: reindent pt. 2"David Lamparter2017-07-221-4/+3
| | | | | | | | | 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>
* *: reindent pt. 2whitespace / reindent2017-07-171-3/+4
| | | | | | | | w/ clang 5 * reflow comments * struct members go 1 per line * binpack algo was adjusted
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-1209/+1180
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge remote-tracking branch 'frr/master' into newline-reduxDavid Lamparter2017-07-141-9/+9
|\ | | | | | | | | | | Lots of conflicts from CMD_WARNING_CONFIG_FAILED... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>