summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_interface.c
AgeCommit message (Collapse)Author
2022-02-09ospf6d: Auth trailer CLI implementation.Abhinay Ramesh
Problem Statement: ================== RFC 7166 support for OSPF6 in FRR code. RCA: ==== This feature is newly supported in FRR Fix: ==== Changes are done to add support for two new CLIs to configure ospf6 authentication trailer feature. One CLI is to support manual key configuration. Other CLI is to configure key using keychain. below CLIs are implemented as part of this commit. this configuration is applied on interface level. Without openssl: ipv6 ospf6 authentication key-id (1-65535) hash-algo <md5|hmac-sha-256> key WORD With openssl: ipv6 ospf6 authentication key-id (1-65535) hash-algo <md5|hmac-sha-256|hmac-sha-1|hmac-sha-384|hmac-sha-512> key WORD With keychain support: ipv6 ospf6 authentication keychain KEYCHAIN_NAME Running config for these command: frr# show running-config Building configuration... Current configuration: ! interface ens192 ipv6 address 2001:DB8:1::2/64 ipv6 ospf6 authentication key-id 10 hash-algo hmac-sha-256 key abhinay ! interface ens224 ipv6 address 2001:DB8:2::2/64 ipv6 ospf6 authentication keychain abhinay ! Risk: ===== Low risk Tests Executed: =============== Have executed the combination of commands. Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
2022-01-24*: do not print vrf name for interface config when using vrf-liteIgor Ryzhov
VRF name should not be printed in the config since 574445ec. The update was done for NB config output but I missed it for regular vty output. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-12Merge pull request #9285 from anlancs/fix-ospf6d-cli-with-nonexist-vrfIgor Ryzhov
ospf6d: add prompt for commands with non-exist vrf
2022-01-12Merge pull request #9292 from mobash-rasool/ospfv3-bug2Igor Ryzhov
ospfv3 is showing enabled on loopback interface although it is not
2022-01-11ospf6d: give error information for commands with non-exist vrfsanlan_cs
Currently the ospf6d's commands with non-exist vrfs can't give the error informations to users. This commit adds a macro "OSPF6_CMD_CHECK_VRF" to give error information if with non-exist vrfs. As usual, skip the checking process in the case of json. So one command can call this macro to do the checking process in its end. At that time it need know json style or not, so add "json" parameter for several related functions. BTW, suppress the build warning of the macro `OSPF6_FIND_VRF_ARGS`: "Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects." Signed-off-by: anlan_cs <anlan_cs@tom.com>
2022-01-10ospf6d: remove ospf6Enabled from json output after deprecation cycleMobashshera Rasool
Since ospf6Enabled and attachedToArea are denoting the same thing. It is decided to remove ospf6Enabled from json output to make CLI and json output similar. Fixes: #9286 Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-11-27*: Remove redundand braces for single statement blocksDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-25ospf6d: Convert vty_out to vty_json for JSONDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.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-05ospf6d: Prevent crash in adj_okDonald Sharp
The adj_ok thread event is being added but not killed when the underlying interface is deleted. I am seeing this crash: OSPF6: Received signal 11 at 1636142186 (si_addr 0x0, PC 0x561d7fc42285); aborting... OSPF6: zlog_signal+0x18c 7f227e93519a 7ffdae024590 /lib/libfrr.so.0 (mapped at 0x7f227e884000) OSPF6: core_handler+0xe3 7f227e97305e 7ffdae0246b0 /lib/libfrr.so.0 (mapped at 0x7f227e884000) OSPF6: funlockfile+0x50 7f227e863140 7ffdae024800 /lib/x86_64-linux-gnu/libpthread.so.0 (mapped at 0x7f227e84f000) OSPF6: ---- signal ---- OSPF6: need_adjacency+0x10 561d7fc42285 7ffdae024db0 /usr/lib/frr/ospf6d (mapped at 0x561d7fbc6000) OSPF6: adj_ok+0x180 561d7fc42f0b 7ffdae024dc0 /usr/lib/frr/ospf6d (mapped at 0x561d7fbc6000) OSPF6: thread_call+0xc2 7f227e989e32 7ffdae024e00 /lib/libfrr.so.0 (mapped at 0x7f227e884000) OSPF6: frr_run+0x217 7f227e92a7f3 7ffdae024ec0 /lib/libfrr.so.0 (mapped at 0x7f227e884000) OSPF6: main+0xf3 561d7fc0f573 7ffdae024fd0 /usr/lib/frr/ospf6d (mapped at 0x561d7fbc6000) OSPF6: __libc_start_main+0xea 7f227e6b0d0a 7ffdae025010 /lib/x86_64-linux-gnu/libc.so.6 (mapped at 0x7f227e68a000) OSPF6: _start+0x2a 561d7fc0f06a 7ffdae0250e0 /usr/lib/frr/ospf6d (mapped at 0x561d7fbc6000) OSPF6: in thread adj_ok scheduled from ospf6d/ospf6_interface.c:678 dr_election() The crash is in the on->ospf6_if pointer is NULL. The only way this could happen from what I can tell is that the event is added to the system and then we immediately delete the interface, removing the memory but not freeing up the adj_ok thread event. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-19Merge pull request #9752 from opensourcerouting/ospf6d-nssa-rangesRuss White
ospf6d: add support for NSSA Type-7 address ranges
2021-10-09ospf6d: add missing vrf parameter to "clear ipv6 ospf6 interface"Igor Ryzhov
Currently, it's not possible to run this command in any VRF other than default. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-05ospf6d: fix selection of NSSA forwarding addressRenato Westphal
Change ospf6_get_nssa_fwd_addr() to try finding a global address on any interface of the area and not on the first one only. Additionally, do a micro-optimization in ospf6_interface_get_global_address() to return as soon as a global address is found. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-04ospf6d: Do not explicitly set the thread pointer to NULLDonatas Abraitis
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF semantics. This is espacially true for the functions we end up calling the thread for. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-09-15ospf6d: cleanup useless checksIgor Ryzhov
om6->ospf6 is always initialized at the start of the execution. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-08-23*: explicitly print "exit" at the end of every node configIgor Ryzhov
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>
2021-08-10ospf6d: GR helper exit scenariosrgirada
Description: Changes to cover all the following GR helper exit scenarios. 1. Upon receiving max age grace lsa.( successful graceful restart) 2. Topo change 3. Grace timer expiry. 4. User changes( like config deletion , interface down) Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2021-08-02Merge pull request #9232 from idryzhov/interface-node-cleanupRenato Westphal
*: cleanup interface node installation
2021-07-30Merge pull request #9028 from mobash-rasool/ospfv3-asbr-summarisationRuss White
Ospfv3 ASBR summarisation feature
2021-07-29*: cleanup interface node installationIgor Ryzhov
The only difference in daemons' interface node definition is the config write function. No need to define the node in every daemon, just pass the callback as an argument to a library function and define the node there. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-07-27Merge pull request #8944 from opensourcerouting/ospf6-mtu-revertIgor Ryzhov
ospf6d: revert PR #8622
2021-07-21ospf6d: Store ospf6 back pointer in route structMobashshera Rasool
Storing the pointer to ospf6 struct in route struct. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-07-20ospf6d: use OSPF6_INTERFACE_LOOPBACK stateDavid Lamparter
The OSPF6_INTERFACE_LOOPBACK interface state wasn't entered anywhere, even if the interface was OSPF6_IFTYPE_LOOPBACK. Fix. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-07-13Merge pull request #9037 from idryzhov/ospf6-freebsdDonald Sharp
ospf6d: fix freebsd mcast group issues
2021-07-12ospf6d: fix freebsd mcast group issuesIgor Ryzhov
There's a delay in FreeBSD between issuing a command to leave a multicast group and an actual leave. If we execute "no router ospf6" and "router ospf6" fast enough, we can end up in a situation when OS performs the leave later than it performs the join and the interface remains without a multicast group. Instead of counting on a one second delay, we must wait until the interface actually leaves the group. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-07-12ospf6d: Correct spelling in debugDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-06-29Revert "ospf6d: Limit the number of interface addresses being supported"David Lamparter
This reverts commit f85b76195aeeb80b6f834da32459a05e297a0a78.
2021-06-27ospf6d: "clear ipv6 ospf6 process" commandYash Ranjan
Adding the "clear ipv6 ospf6 command" . It resets the ospfv3 datastructures and clears the database as well as route tables. It resets the neighborship by restarting the interface state machine. If the user wants to change the router-id, this command updates the router-id to the latest static router-id and starts the neighbor formation with the new router-id. Signed-off-by: Yash Ranjan <ranjany@vmware.com>
2021-06-23ospf6d: Show neighbor displays twice for every neighbor.Abhinay Ramesh
Problem Statement: ================= When show ipv6 ospf6 neighbor is executed each neighbor gets displayed twice. frr# show ipv6 ospf6 neighbor Neighbor ID Pri DeadTime State/IfState Duration I/F[State] 1.1.1.1 1 00:00:39 Full/DR 00:00:10 ens192[BDR] 1.1.1.1 1 00:00:39 Full/DR 00:00:10 ens192[BDR] RCA: ==== Since ospf6_interface gets added twice to if_list we see multiple display output. Fix: ==== add ospf6_interface to if_list only when newly area gets attached to the interface. If its already added no need to add it again. Risk: ===== Low Tests Executed: =============== Have tested the defect scenario. frr# show ipv6 ospf6 neighbor Neighbor ID Pri DeadTime State/IfState Duration I/F[State] 1.1.1.1 1 00:00:35 Full/DR 00:36:04 ens192[BDR] frr# Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
2021-06-22Merge pull request #8725 from pjdruddy/ospfv3_fair_socketRuss White
OSPFv3 socket rework
2021-06-18ospf6d: add write-multiplier configurationPat Ruddy
allow amount of work done by read and write threads in a single invocation to be tuned to between 1 and 100 packets (default 20) Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-06-18ospf6d: add tx fifo infrastructurePat Ruddy
Add per interface fifo and per instance write list as a precursor to implementing fairer sharing of the ospf6 oscket resources. Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-06-14ospf6d: move error logs out from behind debug flagslynne
The logging in ospf6 is very verbose. If you turn on logging on a scaled system you get too many logs. The problem is that there are some errors that occur that are hidden behind the debug flags, and to see these errors we currently need to turn on the debug logging. This change converts these error logs to warnings and removes the debug flags. Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2021-06-10ospf6d: fix undefined functionStephen Worley
Some wires got crossed during a couple merges using/changing this function. Update it to its new name. Signed-off-by: Stephen Worley <sworley@nvidia.com>
2021-06-08ospf6d: fix interface area configurationIgor Ryzhov
Currently the interface area is configured from the router node using "interface IFNAME area ID" command. There are multiple problems with this command: - it is not in line with all other interface-related commands - other parameters are configured from the interface node using "ipv6 ospf6" prefix - it is not in line with OSPFv2 - area is configured from the interface node using "ip ospf area" command - most importantly, it doesn't work correctly when the interface is in a different VRF - instead of configuring the interface, it creates a new fake interface and configuring it instead To fix all the problems, this commit adds a new command to the interface configuration node - "ipv6 ospf6 area ID". The purpose of the command is completely the same, but it works correctly in a multi-VRF environment. The old command is preserved for the backward compatibility, but the warning is added that it is deprecated because it doesn't work correctly with VRFs. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-06-04ospf6d: Support for nssa in ospfv3Kaushik
The following is implemented. 1. Configuring area as NSSA. 2. Generating Type 7 LSA. 3. Conversion of Type 7 to Type 5 ( Default Behavior). 4. NSSA ABR selection. Reviewed-by: Rafael Zalamena <rzalamena@opensourcerouting.org> Co-authored-by: Kaushik <kaushiknath.null@gmail.com> Co-authored-by: Soman K.S <somanks@gmail.com> Signed-off-by: Kaushik <kaushiknath.null@gmail.com>
2021-05-28ospf6d: fix using vrf interface as a loopbackIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-25ospf6d: fix possible crashesIgor Ryzhov
OSPF6 instance may not exist when processing interface state change. Do not execute processing steps that require an instance if an area is not configured for an interface. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-11ospf6d: Limit the number of interface addresses being supportedlynne
The code had no limits on addresses configured on an interface running ospf6d. The code would crash when more than 100 addresses were added. This change limits the number of interface address to 100 if mtu is set to the default value. If the mtu is set to a jumbo packet size or larger we will support 200 interface addresses. Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2021-05-06Merge pull request #8636 from idryzhov/ospfv3-vrf-supportRafael Zalamena
OSPFv3 VRF support
2021-05-06ospf6d: add vty support for multiple vrfsharios_niral
Co-authored-by: Kaushik Nath <kaushiknath.null@gmail.com> Signed-off-by: harios_niral <hari@niralnetworks.com>
2021-05-02ospf6d: Send Link LSAs when interface priority is changedYash Ranjan
As per the ospfv3 conformance test 24.3 SETUP: Configure DIface-0 with priority set to <hprty>. ANVL: Establish full adjacency with DUT for neighbor Rtr-0-A on DIface-0. DUT: Exchange all the <OSPF-DD> packets, during adjacency establish- ment. ANVL: Verify that the received <OSPF-DD> packets contain: • one header of Link-LSA, originated by DUT. ANVL: Send <OSPF-LSR> packet from neighbor Rtr-0-A to DIface-0 con- taining: • One Request Tuple for Link-LSA originated by DUT. ANVL: Listen (for upto 2 * <RxmtInterval> seconds) on DIface-0. DUT: Send <OSPF-LSU> packet. ANVL: Verify that the received <OSPF-LSU> packet contains: • • one Link-LSA, originated by DUT, contains: Rtr Pri field set to <hprty>. ---------- When interface priority is changed Link LSAs should be tranmitted with the priority set. When the link priorty chanages, the drbdr algorithm is called, which can change the state of the interface. But if the state does not changes then LINK LSAs are not transmitted. This PR fixes this issue. If the state is changed, then LINK LSAs will anyways be tranmitted. But in case the state is not changed, even in that case Link LSAs are tranmitted. Signed-off-by: Yash Ranjan <ranjany@vmware.com>
2021-04-22ospf6d: add support for BFD profilesRafael Zalamena
Allow user to pre configure BFD sessions using profiles. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-04-22ospf6d: rework BFD integrationRafael Zalamena
Use the new BFD library to integrate with BFD. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-22ospf6d: kill ospf6_memory.h, use MTYPE_STATICDavid Lamparter
Same as other commits -- convert most DEFINE_MTYPE into the _STATIC variant, and move the remaining non-static ones to appropriate places. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-22Merge pull request #8121 from opensourcerouting/macro-cleanupDonatas Abraitis
*: require ISO C11 + semicolons after file-scope macros
2021-03-17*: require semicolon after DEFINE_QOBJ & co.David Lamparter
Again, see previous commits. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17*: require semicolon after DEFINE_HOOK & co.David Lamparter
See previous commit. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17*: require semicolon after DEFINE_MTYPE & coDavid Lamparter
Back when I put this together in 2015, ISO C11 was still reasonably new and we couldn't require it just yet. Without ISO C11, there is no "good" way (only bad hacks) to require a semicolon after a macro that ends with a function definition. And if you added one anyway, you'd get "spurious semicolon" warnings on some compilers... With C11, `_Static_assert()` at the end of a macro will make it so that the semicolon is properly required, consumed, and not warned about. Consistently requiring semicolons after "file-level" macros matches Linux kernel coding style and helps some editors against mis-syntax'ing these macros. Signed-off-by: David Lamparter <equinox@diac24.net>