summaryrefslogtreecommitdiff
path: root/zebra/rtadv.h
AgeCommit message (Collapse)Author
2024-01-28zebra: convert interface ipv6 nd dnssl command to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: convert interface ipv6 nd rdnss command to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: convert interface ipv6 nd prefix command to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: convert interface ipv6 nd ra interval/lifetime commands to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: convert interface ipv6 nd suppress-ra command to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-12-12zebra: Don't leak memory in rtadv.c code on shutdownDonald Sharp
The adata variable was being leaked on shutdown since it was calloc'ed. There is no need to make this dynamic memory. Just choose a size and use that. Add a bit of code to ensure that if it's not large enough, it will just stop and the developer will fix it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename `struct thread` to `struct event`Donald Sharp
Effectively a massive search and replace of `struct thread` to `struct event`. Using the term `thread` gives people the thought that this event system is a pthread when it is not Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-12-17zebra: Notice Optional Router Advertisement types that are not handledDonald Sharp
Currently when zebra receives a RA with optional types, note the optional types that we are ignoring. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-21zebra: clean up rtadv integrationDavid Lamparter
Move a few things into places they actually belong, and reduce the number of places we have `#ifdev HAVE_RTADV`. Just overall code prettification. ... I had actually done this quite a while ago while doing some other random hacking and thought it more useful to not be sitting on it on my disk... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-04zebra: Add knowledge about RA and RFC 5549 to `show zebra`Donald Sharp
Add to `show zebra` whether or not RA is compiled into FRR and whether or not BGP is using RFC 5549 at the moment. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-06-08zebra: rework RA handling for vrf-liteStephen Worley
Rework RA handling for vrf-lite scenarios. Before we were using a single FD descriptor for polling across multiple zvrf's. This would cause us to hit this assert() in some bgp unnumbered and vrrp configs: ``` /* * What happens if we have a thread already * created for this event? */ if (thread_array[fd]) assert(!"Thread already scheduled for file descriptor"); ``` We were scheduling a thread_read on the same FD for every zvrf. With vrf-lite, RAs and ARPs are not vrf-bound, so we can just use one rtadv instance to manage them for all VRFs. We will choose the default VRF for this. This patch removes the rtadv_sock altogether for zrouter and moves the functionality this represented to the default VRF. All RAs will be handled in the default VRF under vrf-lite configs with only one poll thread started for it. This patch also extends how we track subscribed interfaces (s or msec) to use an actual sorted list by interface names rather than just a counter. With multiple daemons turning interfaces/on/off these counters can get very wrong during ifup/down events. Making them a sorted list prevents this from happening by preventing duplicates. With netns-vrf's nothing should change other than the interface list. Signed-off-by: Stephen Worley <sworley@nvidia.com>
2020-05-08zebra: Remove enum around ipv6_nd_suppress_ra_statusDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-02zebra: Don't kill the global rtadv socket when a vrf is deletedDonald Sharp
The rtadv code has two types of sockets: a) namespace -> Where each zvrf get's it's own socket b) vrf lite -> Where we get 1 socket for everything When we were terminating a vrf we were *always* killing the (b) socket. This is a mistake in that other vrf's may need to be communicating. Modify the code on vrf shutdown to only disable that vrf's event processing and when we actually terminate we shut the socket. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-14zebra: add all ipv6 global addresses to RA messagesDon Slice
RFC 4861 states that ipv6 RA messages sent out an interface should contain all global ipv6 addresses on that interface. This fix adds that capability. To override the default flags and timer settings for a particular prefix, the existing "ipv6 nd prefix ..." command should be used via vtysh under the appropriate interface. Ticket: CM-20363 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-12-03zebra: send RA lifetime of 0 before ceasing to advertise RAsDon Slice
Problem reported by testing agency that RFC4861 section 6.2.5 states that a router should send an RA with a lifetime of 0 before ceasing to send RAs on the interface, or when the interace is shutdown, or the router is shutdown. This fix adds that capability. Ticket: CM-27061 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-12-02*: generously apply constDavid Lamparter
const const const your boat, merrily down the stream... Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-22zebra: knob to make ra retransmit interval rfc compliantDon Slice
Problem reported by testing facility that our sending of Router Advertisements more frequently than once very three seconds is not compliant with rfc4861. Added a knob to turn off fast retransmits in order to meet the requirement of the RFC. Ticket: CM-27063 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-06-04zebra: move rtadv service from zrouter to zvrfPhilippe Guibert
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>
2019-05-16Revert "zebra: move rtadv service from zrouter to zvrf"Donald Sharp
This reverts commit f20e2a09c8aef399698fa074b36f24becdf49cbb.
2019-04-25zebra: move rtadv service from zrouter to zvrfPhilippe Guibert
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>
2019-03-25add cplusplus guards to all zebra headersEmanuele Di Pascale
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2019-02-02zebra: support DNS configuration options in rtadvLars Seipel
Add support for the RDNSS and DNSSL router advertisement options described in RFC 8106. Signed-off-by: Lars Seipel <ls@slrz.net>
2018-04-02Revert "zebra: implement draft-bz-v4goawayflag-00"Quentin Young
This reverts commit 3fec765a8d986664a555c161b814b4bf3332cdf0. April fools! Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-01zebra: implement draft-bz-v4goawayflag-00Quentin Young
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>
2018-03-27*: use C99 standard fixed-width integer typesQuentin Young
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>
2018-03-12zebra: reorganize zserv, batch i/oQuentin Young
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>
2018-03-12zebra: standardize ZAPI message handler argsQuentin Young
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>
2018-03-06*: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2017-10-23zebra: No need to pass sock descriptor around.Donald Sharp
Standardize the api to read zapi requests from protocols. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-15zebra: start detangling rtadv & irdpDavid Lamparter
Replace some cross-dependencies with hooks & move bits to where they belong. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
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>
2017-05-15*: make consistent & update GPLv2 file headersDavid Lamparter
The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-06-08zebra: fix build with rtadv disabledTimo Teräs
Otherwise we get warning on rtadv_init() prototype not being defined when compiling rtadv.c (as dummy stub is provided always). Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-05-02BGP: Trigger IPv6 router advertisements upon config of unnumbered neighborvivek
Instead of turning on IPv6 RA on every interface as soon as it has an IPv6 address, only enable it upon configuration of BGP neighbor. When the BGP neighbor is deleted, signal that RAs can be turned off. To support this, introduce new message interaction between BGP and Zebra. Also, take appropriate actions in BGP upon interface add/del since the unnumbered neighbor could exist prior to interface creation etc. Only unnumbered IPv6 neighbors require RA, the /30 or /31 based neighbors don't. However, to keep the interaction simple and not have to deal with too many dynamic conditions (e.g., address deletes or neighbor change to/from 'v6only'), RAs on the interface are triggered upon any unnumbered neighbor configuration. BGP-triggered RAs will cause RAs to be initiated on the interface; however, if BGP asks that RAs be stopped (upon delete of unnumbered neighbor), RAs will continue to be exchanged if the operator has explicitly enabled. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Ticket: CM-10640 Reviewed By: CCR-4589 Testing Done: Various manual and automated (refer to defect)
2016-03-22Zebra: Restrict IPv6 RA to valid interfacesvivek
Restrict interfaces on which IPv6 Router Advertisements are allowed. The list excludes loopback interfaces including the VRF device interface; specific to Cumulus, it also includes "switch0" and "ethX" interfaces. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> Ticket: CM-9849 Reviewed By: CCR-4334 Testing Done: Manual
2016-02-23debian, config, zebra: Ensure Cumulus Extensions are not auto turned onDonald Sharp
There exist cases where Cumulus Code( in this case code surrounding when we want to send Router Advertisements ) should only be turned on for Cumulus Switches. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-02-19Zebra: Make RA socket operation on a per-NS basisvivek
This patch reorganizes the RA handling to be per namespace rather than per VRF. The VRF library by 6wind had done the original change to make the RA data structures (socket information) per VRF, but this was correct only if each VRF represented a NS. In our reorganization, we have created a NS structure (struct zebra_ns) and VRFs don't correspond to namespaces (i.e., all VRFs exist in the default namespace). So, the RA handling should be done under 'struct zebra_ns'. With the changes, there is a single raw socket per NS (=> 1 for us) on which we will receive and handle RAs for all interfaces. The interface information is available through cmsg and the processing will then happen for that interface. There is a problem with transmitting RAs over a VRF interface. This is tracked by CM-9398. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Ticket: CM-9206 Reviewed By: CCR-4217 Testing Done: Manual testing
2016-02-18Zebra: Restrict automatic RA enable to relevant interfacesvivek
When enabling IPv6 Router Advertisements automatically based on the presence of IPv6 address on an interface, do it only for relevant interfaces. Note: This needs a configure option for completion. Ticket: CM-9358 Reviewed By: CCR-4116 Testing Done: Manual verification
2015-12-07Enable IPv6 ND RA for interfaces that have an IPv6 addressDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Ticket: CM-7932
2015-11-20Quagga: Cleanup RTADV defineDonald Sharp
The RTADV define was not being set correctly or consistently. Make the code consistent with our HAVE_IPV6 define. If the user wants to explicitly turn it off then they should run --disable-rtadv from the configure cli Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2015-10-30zebra: maintain RTADV per VRFFeng Lu
This moves the global variable "rtadv" into the "struct zebra_vrf", so that RTADV feature can work per VRF. * rtadv.c/rtadv.h: Add a proper parameter to the functions so that the entity of the "struct zebra_vrf" and interfaces can be obtained from the specified VRF. The old rtadv_init() is splitted into: - rtadv_cmd_init(): it installs the RTADV commands; is called from main(); - new rtadv_init(): it creates the socket; is called from zebra_vrf_enable(). rtadv_terminate() is added to stop the threads, close the socket and clear the counters. It is called from zebra_vrf_disable(). rtadv_make_socket() now calls vrf_socket() to create a socket in the VRF. * interface.h and rib.h: define the macro RTADV. * main.c: according changes, refer to rtadv.c. Signed-off-by: Feng Lu <lu.feng@6wind.com> Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Vincent JARDIN <vincent.jardin@6wind.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Conflicts: zebra/interface.h zebra/rib.h zebra/rtadv.c zebra/rtadv.h
2012-05-09zebra: fix up compilation without rtadv/IPv6Joachim Nilsson
let's ground the rtadv.h file if route advertisements are disabled. And fix up the CLI for it, as well as move the "show ip mroute" to its proper place. * zebra/rtadv.h: #ifdef RTADV * zebra/main.c: #ifdef RTADV * zebra/zebra_vty.c: move "show ip mroute" out of #ifdef IPV6 From: Joachim Nilsson <troglobit@gmail.com> [moved #ifdef RTADV to rtadv.h] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-01-26zebra: freshen RFC references in rtadvDenis Ovsienko
RFC2461 was replaced by RFC4861 RFC3775 was replaced by RFC6275 draft-ietf-mip6-mipext-advapi-03 was replaced by RFC4584
2012-01-26zebra: use prefix_ipv6 in rtadv_prefixDenis Ovsienko
rtadv_prefix.prefix was casted to "struct prefix_ipv6" and had the same size, make it exactly this type to make the code a bit cleaner.
2009-06-23RFC 4191 Default Router Preference support for router advertisementsChris Caputo
Adds "ipv6 nd router-preference (high|medium|low)" and "no ipv6 nd router-preference" interface commands. Files modified: doc/ipv6.texi zebra/interface.c zebra/interface.h zebra/rtadv.c zebra/rtadv.h Signed-off-by: Chris Caputo <ccaputo@alt.net>
2008-08-22[warnings] Fix various SOS warningsPaul Jakma
2008-08-15 Paul Jakma <paul.jakma@sun.com> * */*: Fix various problems flagged by Sun Studio compiler. - '<qualifier> <storage>' obsolescent in declarations - empty statements (';' after ALIAS definitions) - implicit declarations (e.g printstack in lib/log.c) - "\%" in printf string instead of "%%" - loops that return on the first iteration (legitimately, but compiler can't really know), e.g. bgp_routemap.c - internal declarations which mask prototypes.
2007-05-10[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warningsPaul Jakma
2007-05-09 Paul Jakma <paul.jakma@sun.com> * configure.ac: sys/conf.h depends on sys/param.h, at least on FBSD 6.2. (bug #363) Should check for in_pktinfo for IRDP 2006-05-27 Paul Jakma <paul.jakma@sun.com> * configure.ac: General cleanup of header and type checks, introducing an internal define, QUAGGA_INCLUDES, to build up a list of stuff to include so as to avoid 'present but cant be compiled' warnings. Misc additional checks of things missing according to autoscan. Add LIBM, for bgpd's use of libm, so as to avoid burdening LIBS, and all the binaries, with libm linkage. Remove the bad practice of using m4 changequote(), just quote the []'s in the case statements properly. This should fix bugs 162, 303 and 178. * */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN, * bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2006-08-06[zebra] trivial: rtadv.h depends on interface.hPaul Jakma
2006-08-06 Paul Jakma <paul.jakma@sun.com> * rtadv.h: depends on interface.h, so should include it.
2005-06-282005-06-28 Paul Jakma <paul.jakma@sun.com>paul
* (global) Extern and static'ification, with related fixups of declarations, ensuring files include their own headers, etc. if_ioctl.c: (interface_info_ioctl) fix obvious arg mis-order in list loop