summaryrefslogtreecommitdiff
path: root/zebra/rtadv.c
AgeCommit message (Collapse)Author
2024-08-15*: Fix spelling errors foundDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-10zebra: rtadv uses uninited data to sendmsgDonald Sharp
valgrind is complaining about this problem. This fixes it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-28zebra: convert to mgmtdIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: convert interface configuration output to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
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 router-preference command to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: convert interface ipv6 nd home-agent-lifetime command to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: convert interface ipv6 nd home-agent-preference command to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: convert interface ipv6 nd adv-interval-option command to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: convert interface ipv6 nd home-agent-config-flag command to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: convert interface ipv6 nd ra-fast-retrans command to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: convert interface ipv6 nd ra-hop-limit command to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: convert interface ipv6 nd ra-retrans-interval command to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: convert interface ipv6 nd mtu command to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: convert interface ipv6 nd other-config-flag command to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: convert interface ipv6 nd managed-config-flag command to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: convert interface ipv6 nd reachable-time 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>
2024-01-04*: Remove cost of including netinet/icmp.h everywhereDonald Sharp
This file inclusion is only used in 3 places move the includes to those spots. Signed-off-by: Donald Sharp <sharpd@nvidia.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-11-21*: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZDonald Sharp
INTERFACE_NAMSIZ is just a redefine of IFNAMSIZ and IFNAMSIZ is the standard for interface name length on all platforms that FRR currently compiles on. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert event.h to frrevent.hDonald Sharp
We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert THREAD_XXX macros to EVENT_XXX macrosDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_add_XXX functions to event_add_XXXDonald Sharp
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-03-24*: Rename thread.[ch] to event.[ch]Donald Sharp
This is a first in a series of commits, whose goal is to rename the thread system in FRR to an event system. There is a continual problem where people are confusing `struct thread` with a true pthread. In reality, our entire thread.c is an event system. In this commit rename the thread.[ch] files to event.[ch]. 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-10-26build, vtysh: extract vtysh commands from .xrefDavid Lamparter
Rather than running selected source files through the preprocessor and a bunch of perl regex'ing to get the list of all DEFUNs, use the data collected in frr.xref. This not only eliminates issues we've been having with preprocessor failures due to nonexistent header files, but is also much faster. Where extract.pl would take 5s, this now finishes in 0.2s. And since this is a non-parallelizable build step towards the end of the build (dependent on a lot of other things being done already), the speedup is actually noticeable. Also files containing CLI no longer need to be listed in `vtysh_scan` since the .xref data covers everything. `#ifndef VTYSH_EXTRACT_PL` checks are equally obsolete. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-04zebra: ignore unspec RetransTimer in RA validationTrey Aspelund
Section 6.2.7 of RFC 4861 states that a router SHOULD log inconsistencies in RA information detected on a given link: ``` - Cur Hop Limit values (except for the unspecified value of zero other inconsistencies SHOULD be logged to system network management). - Values of the M or O flags. - Reachable Time values (except for the unspecified value of zero). - Retrans Timer values (except for the unspecified value of zero). - Values in the MTU options. - Preferred and Valid Lifetimes for the same prefix. If AdvPreferredLifetime and/or AdvValidLifetime decrement in real time as specified in Section 6.2.1 then the comparison of the lifetimes cannot compare the content of the fields in the Router Advertisement, but must instead compare the time at which the prefix will become deprecated and invalidated, respectively. Due to link propagation delays and potentially poorly synchronized clocks between the routers such comparison SHOULD allow some time skew. ``` We were not logging inconsistencies if "the unspecified value of zero" was used for Reachable Time but were logging them for Retrans Timer. This updates the validation check to also skip the logging of Retrans Timer inconsistencies if either local/rx value is 0. Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2022-10-04zebra: show local/rx values in RA mismatch debugsTrey Aspelund
When we process a received Router Advertisement we have some logic in place to detect and log mismatches in a handful of flags/values. However, these logs do not include what the actual values are, which means it's up to the operator to grab a packet capture and compare that against the local configuration... So let's make life a little easier by including those in the log itself. Before: ``` 2022/09/30 20:37:16 ZEBRA: [KV2V1-7GM7G][EC 4043309149] enp1s0(2): Rx RA - our AdvCurHopLimit doesn't agree with fe80::5054:ff:feca:b085 2022/09/30 20:37:16 ZEBRA: [KS0BP-4GR8K][EC 4043309149] enp1s0(2): Rx RA - our AdvManagedFlag doesn't agree with fe80::5054:ff:feca:b085 2022/09/30 20:37:16 ZEBRA: [RE4EC-VYEJ2][EC 4043309149] enp1s0(2): Rx RA - our AdvOtherConfigFlag doesn't agree with fe80::5054:ff:feca:b085 2022/09/30 20:37:16 ZEBRA: [X6794-9MW18][EC 4043309149] enp1s0(2): Rx RA - our AdvReachableTime doesn't agree with fe80::5054:ff:feca:b085 2022/09/30 20:37:16 ZEBRA: [S1KXC-H8F4W][EC 4043309149] enp1s0(2): Rx RA - our AdvRetransTimer doesn't agree with fe80::5054:ff:feca:b085 ``` After: ``` Sep 30 20:45:18 ub20-2 zebra[47487]: [GSW5Z-V7DZN][EC 4043309149] enp1s0(2): Rx RA - our AdvCurHopLimit (14) doesn't agree with fe80::5054:ff:fe9a:e2ca (64) Sep 30 20:45:18 ub20-2 zebra[47487]: [RHHTS-F96DR][EC 4043309149] enp1s0(2): Rx RA - our AdvManagedFlag (0) doesn't agree with fe80::5054:ff:fe9a:e2ca (1) Sep 30 20:45:18 ub20-2 zebra[47487]: [MNBY3-FTN6W][EC 4043309149] enp1s0(2): Rx RA - our AdvOtherConfigFlag (0) doesn't agree with fe80::5054:ff:fe9a:e2ca (1) Sep 30 20:45:18 ub20-2 zebra[47487]: [GG62B-XXWR0][EC 4043309149] enp1s0(2): Rx RA - our AdvReachableTime (20) doesn't agree with fe80::5054:ff:fe9a:e2ca (777) Sep 30 20:45:18 ub20-2 zebra[47487]: [YG220-D6B4H][EC 4043309149] enp1s0(2): Rx RA - our AdvRetransTimer (13) doesn't agree with fe80::5054:ff:fe9a:e2ca (0) ``` Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2022-09-23zebra: changes for code maintainabilitysri-mohan1
these changes are for improving the code maintainability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-07-19zebra: Add some more data to rtadv socket failuresDonald Sharp
The creation of the rtadv socket can fail but there is very very little data associated with this event to let the operator know something has gone terribly wrong. Please note if this socket fails to create or fails the setsockopt's rtadv is basically just really really messed up. I am not sure what can be done here. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-24zebra: Fix rtadv startup when config read in is before interface upDonald Sharp
When a interface is configured with this: int eva ipv6 nd ra-interval 5 no ipv6 nd suppress-ra ! And then subsuquently the interface is created and brought up, FRR would both error on joining the RA multicast address and never properly work in this state. Delay the startup of the join and start of the Router Advertisements until after the ifindex has actually been found. 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-05-11*: Properly use memset() when zeroingDonatas Abraitis
Wrong: memset(&a, 0, sizeof(struct ...)); Good: memset(&a, 0, sizeof(a)); Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-31zebra: don't send RAs w/o LLv6 or on bridge-portsTrey Aspelund
It's confusing for a user to see 'Tx RA failed' in the logs when they've enabled RAs (either through interface config or BGP unnumbered) on an interface that can't send them. Let's avoid sending RAs on interfaces that are bridge_slaves or don't have a link-local address, since they are the two of the most common reasons for RA Tx failures. Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2022-02-23*: Change thread->func to return void instead of intDonald Sharp
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>
2022-02-04Merge pull request #10501 from donaldsharp/more_zebra_showJafar Al-Gharaibeh
More zebra show
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>
2022-01-28zebra: Make Router Advertisement warnings show up once every 6 hoursDonald Sharp
RA packets are pretty chatty and when there is a warning from a missconfiguration on the network, the log file gets filed up with warnings. Modify the code in rtadv.c to only spit out the warning in these cases at most every 6 hours. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-22*: cleanup ifp->vrf_idIgor Ryzhov
Since f60a1188 we store a pointer to the VRF in the interface structure. There's no need anymore to store a separate vrf_id field. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-16*: unify if_is_loopback/if_is_loopback_or_vrfIgor Ryzhov
We should always treat the VRF interface as a loopback. Currently, this is not the case, because in some old pre-VRF code we use if_is_loopback instead of if_is_loopback_or_vrf. To avoid any future problems, the proposal is to rename if_is_loopback_or_vrf to if_is_loopback and use it everywhere. if_is_loopback is renamed to if_is_loopback_exact in case it's ever needed, but currently it's not used anywhere. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-05zebar: Fix the RA sent fail in netns modeLEI BAO
Make the code more explicit. Signed-off-by: LEI BAO <bali.baolei@cn.ibm.com>
2021-11-05zebra: Fix the RA send failed in netns modeLEI BAO
In the rtadv_timer(), it always uses the zvrf's socket to send RA packets. In the vrf-lite mode, it's righ since it uses the default vrf to send the RA packets. But in the netns mode, it uses socket in each netns. So the issue only happens in the netns mode because the zvrf's socket may not be in the same netns as the interface's netns. In order to compatible with both vrf-lite and netns mode, the fix uses the if_lookup_by_index() to check whether interfaces can use the zvrf's socket. Signed-off-by: LEI BAO <bali.baolei@cn.ibm.com>
2021-11-02zebra: Fix the RA packets can not sent outLEI BAO
Skip the interfaces which not belong to the same VRF as the current thread's zvrf. Signed-off-by: LEI BAO <bali.baolei@cn.ibm.com>
2021-09-30*: cleanup interface loopback/vrf checkIgor Ryzhov
There's a helper function to check whether the interface is loopback or VRF - if_is_loopback_or_vrf. Let's use it whenever we need to check that. There's no functional change in this commit. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>