summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_message.c
AgeCommit message (Collapse)Author
2022-06-01ospf6d: fix rx/tx buffer sizesDavid Lamparter
OSPFv3 packets can be fragmented and up to 64k long, regardless of interface MTU. Trying to size these buffers to MTU is just plain wrong. To not make this a super intrusive change during the 8.3 release freeze, just code this into ospf6_iobuf_size(). Since the buffer is now always 64k, don't waste time zeroing the entire thing in receive; instead just zero kind of a "sled" of 128 bytes after the buffer as a security precaution. Fixes: #11298 Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-05-20ospf6d: Clean up thread interfaceDonald Sharp
a) Remove setting of thread pointer to NULL after thread invocation, this is already done. b) Use thread_is_scheduled() Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-16ospf6d: Ensure the ospf6 interface hello timer pops in all casesDonald Sharp
If a end users does something like this: int enp39s0 ipv6 ospf6 hello-interval 65535 And then the timer pops and we send the hello and immediately if the end user does this: ipv6 ospf6 hello-interval 5 The timer is not being reset and FRR waits the full 65k seconds before sending the hello again, which then immediately sets the next hello to go out in 5 seconds. When FRR receives the new timer value, look at how much time is left on the timer in seconds. If this value is greater than the new hello timer, stop the timer and set it too that value. This should fix a CI system test failure found, where the system is testing setting timer from things like 12 seconds to 65k seconds then back down to 12 and that the ospf6 neighbor relationship stays up. The code was also changed from thread_add_event to thread_add_timer in all cases. I am not sure what would happen if a show command comes in for a thread timer remaining with an event instead of a timer just make it consistent. This was chased down because the support bundle showed this: r0# show ipv6 ospf6 vrf all interface r0-r1-eth0 is up, type BROADCAST Interface ID: 6 Internet Address: inet6: fe80::a4ea:d3ff:fe35:cef1/64 inet6: fd00::1/64 Instance ID 0, Interface MTU 1500 (autodetect: 1500) MTU mismatch detection: enabled Area ID 0.0.0.0, Cost 10 State DR, Transmit Delay 1 sec, Priority 1 Timer intervals configured: Hello 12(65480.960), Dead 48, Retransmit 5 And looking at the test code is doing stuff like this: 2022/05/16 17:08:15 OSPF6: [M7Q4P-46WDR] vty[5]@(config)# interface r1-r0-eth0 2022/05/16 17:08:15 OSPF6: [M7Q4P-46WDR] vty[5]@(config-if)# ipv6 ospf6 hello-interval 65535 2022/05/16 17:08:15 OSPF6: [M7Q4P-46WDR] vty[5]@(config-if)# no ipv6 ospf6 hello-interval 2022/05/16 17:08:16 OSPF6: [M7Q4P-46WDR] vty[5]@(config-if)# ipv6 ospf6 hello-interval 1 2022/05/16 17:08:16 OSPF6: [M7Q4P-46WDR] vty[5]@(config-if)# ipv6 ospf6 hello-interval 12 If the old timer value pops, the hello interval is set to 65k and never reset again. Signed-off-by: Donald Sharp <sharpd@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-14ospf6d: fix coverity issues.Abhinay Ramesh
Fixed below coverity issues ________________________________________________________________________________________________________ *** CID 1511366: (TAINTED_SCALAR) /ospf6d/ospf6_message.c: 2631 in ospf6_make_lsupdate_list() 2625 + OSPF6_HEADER_SIZE) 2626 > ospf6_packet_max(on->ospf6_if)) { 2627 ospf6_fill_header(on->ospf6_if, (*op)->s, 2628 length + OSPF6_HEADER_SIZE); 2629 (*op)->length = length + OSPF6_HEADER_SIZE; 2630 ospf6_fill_lsupdate_header((*op)->s, *lsa_cnt); >>> CID 1511366: (TAINTED_SCALAR) >>> Passing tainted variable "(*op)->length" to a tainted sink. 2631 ospf6_send_lsupdate(on, NULL, *op); 2632 2633 /* refresh packet */ 2634 *op = ospf6_packet_new(on->ospf6_if->ifmtu); 2635 length = OSPF6_LS_UPD_MIN_SIZE; 2636 *lsa_cnt = 0; /ospf6d/ospf6_message.c: 2631 in ospf6_make_lsupdate_list() 2625 + OSPF6_HEADER_SIZE) 2626 > ospf6_packet_max(on->ospf6_if)) { 2627 ospf6_fill_header(on->ospf6_if, (*op)->s, 2628 length + OSPF6_HEADER_SIZE); 2629 (*op)->length = length + OSPF6_HEADER_SIZE; 2630 ospf6_fill_lsupdate_header((*op)->s, *lsa_cnt); >>> CID 1511366: (TAINTED_SCALAR) >>> Passing tainted variable "(*op)->length" to a tainted sink. 2631 ospf6_send_lsupdate(on, NULL, *op); ________________________________________________________________________________________________________ *** CID 1511365: (TAINTED_SCALAR) /ospf6d/ospf6_message.c: 2674 in ospf6_make_ls_retrans_list() 2669 if (on->ospf6_if->state == OSPF6_INTERFACE_POINTTOPOINT) 2670 (*op)->dst = allspfrouters6; 2671 else 2672 (*op)->dst = on->linklocal_addr; 2673 >>> CID 1511365: (TAINTED_SCALAR) >>> Passing tainted variable "(*op)->length" to a tainted sink. 2674 ospf6_fill_hdr_checksum(on->ospf6_if, *op); 2675 ospf6_packet_add(on->ospf6_if, *op); 2676 OSPF6_MESSAGE_WRITE_ON(on->ospf6_if); /ospf6d/ospf6_message.c: 2674 in ospf6_make_ls_retrans_list() 2669 if (on->ospf6_if->state == OSPF6_INTERFACE_POINTTOPOINT) 2670 (*op)->dst = allspfrouters6; 2671 else 2672 (*op)->dst = on->linklocal_addr; 2673 >>> CID 1511365: (TAINTED_SCALAR) >>> Passing tainted variable "(*op)->length" to a tainted sink. 2674 ospf6_fill_hdr_checksum(on->ospf6_if, *op); 2675 ospf6_packet_add(on->ospf6_if, *op); 2676 OSPF6_MESSAGE_WRITE_ON(on->ospf6_if); /ospf6d/ospf6_message.c: 2674 in ospf6_make_ls_retrans_list() 2668 ospf6_fill_lsupdate_header((*op)->s, *lsa_cnt); 2669 if (on->ospf6_if->state == OSPF6_INTERFACE_POINTTOPOINT) 2670 (*op)->dst = allspfrouters6; 2671 else 2672 (*op)->dst = on->linklocal_addr; 2673 >>> CID 1511365: (TAINTED_SCALAR) >>> Passing tainted variable "(*op)->length" to a tainted sink. 2674 ospf6_fill_hdr_checksum(on->ospf6_if, *op); 2675 ospf6_packet_add(on->ospf6_if, *op); 2676 OSPF6_MESSAGE_WRITE_ON(on->ospf6_if); ________________________________________________________________________________________________________ *** CID 1511364: Insecure data handling (TAINTED_SCALAR) /ospf6d/ospf6_message.c: 2125 in ospf6_write() 2120 if (oi->at_data.flags != 0) { 2121 at_len = ospf6_auth_len_get(oi); 2122 if (at_len) { 2123 iovector[0].iov_len = 2124 ntohs(oh->length) + at_len; >>> CID 1511364: Insecure data handling (TAINTED_SCALAR) >>> Passing tainted variable "iovector[0].iov_len" to a tainted sink. 2125 ospf6_auth_digest_send(oi->linklocal_addr, oi, 2126 oh, at_len, 2127 iovector[0].iov_len); 2128 } else { 2129 iovector[0].iov_len = ntohs(oh->length); 2130 } ________________________________________________________________________________________________________ *** CID 1511363: (DEADCODE) /ospf6d/ospf6_auth_trailer.c: 275 in ospf6_hash_hmac_sha_digest() 269 case KEYCHAIN_ALGO_HMAC_SHA512: 270 #ifdef CRYPTO_OPENSSL 271 sha512_digest(mes, len, digest); 272 #endif 273 break; 274 case KEYCHAIN_ALGO_NULL: >>> CID 1511363: (DEADCODE) >>> Execution cannot reach this statement: "case KEYCHAIN_ALGO_MAX:". 275 case KEYCHAIN_ALGO_MAX: 276 default: /ospf6d/ospf6_auth_trailer.c: 274 in ospf6_hash_hmac_sha_digest() 269 case KEYCHAIN_ALGO_HMAC_SHA512: 270 #ifdef CRYPTO_OPENSSL 271 sha512_digest(mes, len, digest); 272 #endif 273 break; >>> CID 1511363: (DEADCODE) >>> Execution cannot reach this statement: "case KEYCHAIN_ALGO_NULL:". 274 case KEYCHAIN_ALGO_NULL: 275 case KEYCHAIN_ALGO_MAX: 276 default: ________________________________________________________________________________________________________ *** CID 1511362: Insecure data handling (TAINTED_SCALAR) /ospf6d/ospf6_auth_trailer.c: 541 in ospf6_auth_check_digest() 535 536 auth_len = ntohs(ospf6_auth->length); 537 538 memcpy(temp_hash, ospf6_auth->data, hash_len); 539 memcpy(ospf6_auth->data, apad, hash_len); 540 >>> CID 1511362: Insecure data handling (TAINTED_SCALAR) >>> Passing tainted variable "oh_len + auth_len + lls_block_len" to a tainted sink. 541 ospf6_auth_update_digest(oi, oh, ospf6_auth, auth_str, 542 (oh_len + auth_len + lls_block_len), 543 hash_algo); ________________________________________________________________________________________________________ *** CID 1511361: Insecure data handling (TAINTED_SCALAR) /ospf6d/ospf6_auth_trailer.c: 124 in ospf6_auth_hdr_dump_recv() 118 at_len = length - (oh_len + lls_len); 119 if (at_len > 0) { 120 ospf6_at_hdr = 121 (struct ospf6_auth_hdr *)((uint8_t *)ospfh + oh_len); 122 at_hdr_len = ntohs(ospf6_at_hdr->length); 123 hash_len = at_hdr_len - OSPF6_AUTH_HDR_MIN_SIZE; >>> CID 1511361: Insecure data handling (TAINTED_SCALAR) >>> Passing tainted variable "hash_len" to a tainted sink. 124 memcpy(temp, ospf6_at_hdr->data, hash_len); 125 temp[hash_len] = '\0'; ________________________________________________________________________________________________________ *** CID 1482146: Insecure data handling (TAINTED_SCALAR) /ospf6d/ospf6_message.c: 2787 in ospf6_lsupdate_send_neighbor_now() 2781 2782 if (IS_OSPF6_DEBUG_FLOODING 2783 || IS_OSPF6_DEBUG_MESSAGE(OSPF6_MESSAGE_TYPE_LSUPDATE, SEND_HDR)) 2784 zlog_debug("%s: Send lsupdate with lsa %s (age %u)", __func__, 2785 lsa->name, ntohs(lsa->header->age)); 2786 >>> CID 1482146: Insecure data handling (TAINTED_SCALAR) >>> Passing tainted variable "op->length" to a tainted sink. 2787 ospf6_send_lsupdate(on, NULL, op); Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
2022-02-09ospf6d: Stitching the auth trailer code with rest of ospf6.Abhinay Ramesh
Problem Statement: ================== RFC 7166 support for OSPF6 in FRR code. RCA: ==== This feature is newly supported in FRR Fix: ==== Core functionality implemented in previous commit is stitched with rest of ospf6 code as part of this commit. Risk: ===== Low risk Tests Executed: =============== Have executed the combination of commands. Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
2021-11-25ospf6d: check N-bit set in Hello packetckishimo
RFC 3101 states both E-bit and N-bit need to be checked when receiving a Hello packet. "To support the NSSA option an additional check must be made in the function that handles the receiving of the Hello packet to verify that both the N-bit and the E-bit found in the Hello packet's option field match the area type and ExternalRoutingCapability of the area of the receiving interface." This PR adds the check for the N-bit Signed-off-by: ckishimo <carles.kishimoto@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-05ospf6d: Prevent use after freeDonald Sharp
I am seeing a crash of ospf6d with this stack trace: OSPF6: Received signal 11 at 1636042827 (si_addr 0x0, PC 0x55efc2d09ec2); aborting... OSPF6: zlog_signal+0x18c 7fe20c8ca19a 7ffd08035590 /lib/libfrr.so.0 (mapped at 0x7fe20c819000) OSPF6: core_handler+0xe3 7fe20c90805e 7ffd080356b0 /lib/libfrr.so.0 (mapped at 0x7fe20c819000) OSPF6: funlockfile+0x50 7fe20c7f8140 7ffd08035800 /lib/x86_64-linux-gnu/libpthread.so.0 (mapped at 0x7fe20c7e4000) OSPF6: ---- signal ---- OSPF6: ospf6_neighbor_state_change+0xdc 55efc2d09ec2 7ffd08035d90 /usr/lib/frr/ospf6d (mapped at 0x55efc2c8e000) OSPF6: exchange_done+0x15c 55efc2d0ab4a 7ffd08035dc0 /usr/lib/frr/ospf6d (mapped at 0x55efc2c8e000) OSPF6: thread_call+0xc2 7fe20c91ee32 7ffd08035df0 /lib/libfrr.so.0 (mapped at 0x7fe20c819000) OSPF6: frr_run+0x217 7fe20c8bf7f3 7ffd08035eb0 /lib/libfrr.so.0 (mapped at 0x7fe20c819000) OSPF6: main+0xf3 55efc2cd7573 7ffd08035fc0 /usr/lib/frr/ospf6d (mapped at 0x55efc2c8e000) OSPF6: __libc_start_main+0xea 7fe20c645d0a 7ffd08036000 /lib/x86_64-linux-gnu/libc.so.6 (mapped at 0x7fe20c61f000) OSPF6: _start+0x2a 55efc2cd706a 7ffd080360d0 /usr/lib/frr/ospf6d (mapped at 0x55efc2c8e000) OSPF6: in thread exchange_done scheduled from ospf6d/ospf6_message.c:2264 ospf6_dbdesc_send_newone() The stack trace when decoded is: (gdb) l *(ospf6_neighbor_state_change+0xdc) 0x7bec2 is in ospf6_neighbor_state_change (ospf6d/ospf6_neighbor.c:200). warning: Source file is more recent than executable. 195 on->name, ospf6_neighbor_state_str[prev_state], 196 ospf6_neighbor_state_str[next_state], 197 ospf6_neighbor_event_string(event)); 198 } 199 200 /* Optionally notify about adjacency changes */ 201 if (CHECK_FLAG(on->ospf6_if->area->ospf6->config_flags, 202 OSPF6_LOG_ADJACENCY_CHANGES) 203 && (CHECK_FLAG(on->ospf6_if->area->ospf6->config_flags, 204 OSPF6_LOG_ADJACENCY_DETAIL) OSPFv3 is creating the event without a managing thread and as such if the event is not run before a deletion event comes in memory will be freed up and we'll start trying to access memory we should not. Modify ospfv3 to track the thread and appropriately stop it when the memory is deleted or it is no longer need to run that bit of code. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-06Merge pull request #9699 from manojvn/379032-devRuss White
ospf6d: minor struct compare issues.
2021-10-06ospf6d: code cleanup.Manoj Naragund
removal of some of the deadcode in ospf6d. Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
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-21ospf6d: Always pre-init all header values to 0Donald Sharp
When making the ospf6 header, let's actually fill in all the header values Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-16ospf6d: introduce support for Graceful Restart (restarting mode)Renato Westphal
RFC 5187 specifies the Graceful Restart enhancement to the OSPFv3 routing protocol. This commit implements support for the GR restarting mode. Here's a quick summary of how the GR restarting mode works: * GR can be enabled on a per-instance basis using the `graceful-restart [grace-period (1-1800)]` command; * To perform a graceful shutdown, the `graceful-restart prepare ipv6 ospf` EXEC-level command needs to be issued before restarting the ospf6d daemon (there's no specific requirement on how the daemon should be restarted); * `graceful-restart prepare ospf` will initiate the graceful restart for all GR-enabled instances by taking the following actions: o Flooding Grace-LSAs over all interfaces o Freezing the OSPF routes in the RIB o Saving the end of the grace period in non-volatile memory (a JSON file stored in `$frr_statedir`) * Once ospf6d is started again, it will follow the procedures described in RFC 3623 until it detects it's time to exit the graceful restart (either successfully or unsuccessfully). Testing done: * New topotest featuring a multi-area OSPF topology (including stub and NSSA areas); * Successful interop tests against IOS-XR routers acting as helpers. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-08-31ospf6d: fix unguarded GR debug messageRenato Westphal
The message about ignoring a one-way hello should only be logged when the router is acting a helper for another one. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-08-11ospf6d: GR helper configurationsrgirada
Description: Adding the following cli commands to enable/disable GR helper functionality. 1. [no] graceful-restart helper-only [A.B.C.D] 2. [no] graceful-restart helper lsa-check-disable 3. [no] graceful-restart helper planned-only 4. [no] graceful-restart helper supported-grace-time (10-1800) show commands: show ipv6 ospf6 graceful-restart helper [detail] [json] Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2021-08-10ospf6d: Helper functionality changesrgirada
Description: 1. changes to process GRACE LSA packet. 2. Validation changes to enter Helper role. 3. Helper functionality during graceful restart. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2021-07-14ospf6d: remove extra debug messageRafael Zalamena
Somehow the hello message debugging code slipped outside the debug guard. Lets just remove it. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-07-09Merge pull request #8978 from kssoman/ospf_newRafael Zalamena
ospf6d : Send LSA update immediately when ospf instance is deleted
2021-07-08ospf6d : Send LSA update immediately when ospf instance is deletedSoman K.S
Fix: The fix is to call ospf6_write to send the packet immediately to all neighbors Signed-off-by: kssoman <somanks@gmail.com>
2021-07-06Merge pull request #8930 from pjdruddy/ospf6_packet_debugDonald Sharp
Ospf6 packet debug
2021-06-26ospf6d: remove inet_ntop calls in ospf6_writePat Ruddy
substitute pI6 formatter. Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-06-26ospf6d: correctly protect packet debugs in ospf6_writePat Ruddy
Some unprotected debugs need to have macro protection, Split these into the existing covering macro section to remove a check per-packet from the main path. Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-06-26ospf6: fix coverity overflow issuesPat Ruddy
Coverity flagged the possibility of an overflow in the latency calculation, ensure that 64 bit integers are used in the calculation to avoid this error. Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-06-26ospf6d: fix duplicated packet readIgor Ryzhov
When OSPFv3 router is configured in both default and non-default VRFs, every packet destined to a non-default VRF is read twice. This makes it impossible to establish neighborship because every DbDesc packet is treated as duplicated and we end up infinitely exchanging DbDescs. We should drop packets received in the default VRF if an interface we received it on is bound to another VRF. Same thing was done for OSPFv2 in 555691e. Signed-off-by: Igor Ryzhov <iryzhov@nfware.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 warning log for late hello packetsPat Ruddy
On transmit and receive calculate the time since the last hello was seen and log a warning if it is late by more than the hello period. Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-06-18ospf6d: add lsupdate messages to tx fifoPat Ruddy
queue outgoing lsupdate messages to the interface tx FIFO and schedule the ospf_write task to deal with them. Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-06-18ospf6d: add lsack messages to tx fifoPat Ruddy
queue outgoing lsack messages to the interface tx FIFO and schedule the ospf_write task to deal with them. Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-06-18ospf6d: add lsreq messages to tx fifoPat Ruddy
queue outgoing lsreq messages to the interface tx FIFO and schedule the ospf_write task to deal with them. Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-06-18ospf6d: add dbdesc messages to tx FIFOPat Ruddy
enqueue outgoing dbdesc messages to the end of the tx FIFO and schedule the ospf6_write task to deal with them. Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-06-18ospf6d: add hello messages to tx fifoPat Ruddy
queue outgoing hello messages to the interface tx FIFO and schedule the ospf_write task to deal with them. Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-06-18ospf6d: add packet apisPat Ruddy
Add APIs to create, queue and dequeue OSPFv3 packets 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-18ospf6d: read ospf6 socket until failurePat Ruddy
To ensure we read all the datagrams availabe from a socket when the read task is scheduled, make the read helper return and error or continue enum and loop unitl an error is received. This requires the read from the socket to be non blocking Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-06-18ospf6d: create an ospf_read_helper functionPat Ruddy
Take the contents of ospf6_receive and split the funtionality that deals with a single packet receipt and place it in a separate helper function. This is the first step in a refactor process to allow the ospf6_read task to read until failure. 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-04ospf6d: missing NSSA areas handlingRafael Zalamena
Patch provided by Soman K.S. with small alterations. Signed-off-by: Soman K.S <somanks@gmail.com> Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-05-26ospf6d: fix debug message config writeIgor Ryzhov
Fix the following issues: - if "send" is combined with "recv-hdr", only "send" is shown - if "recv" is combined with "send-hdr", only "recv" is shown - if both "send-hdr" and "recv-hdr" are enabled, "; header only" is shown Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29ospf6d: Make debug logs configurable to only display message headerslynne
This change allows the user to only log the message header and not include all the LSAs in each packet. In a large setup printing out all the LSAs in each packet can make the system very hard to debug. When the user finds an issue with the adjacency not coming up or in a specific packet type they can turn on a full dump of the message. Signed-off-by: Lynne Morrison <lynne@voltanet.io>
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-16ospfd6: Clear locks when ospf messages need to be chunkedlynne
When there are too many LSA updates to be sent in a packet the code needs to correctly clear the locks that are taken while walking the lists and then wait for the appropriate timer to expire to continue walking the list. The routine that was being called would not properly remove all the locks that needed to be cleared, and would also try to incorrectly delete the lsa/route. The code now clears the locks and leaves the lsa on the list. When the timers fire again the code continues walking the list to send the rest of the lsas to the neighbor. Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2021-03-14*: fix printf extension typesDavid Lamparter
Some mistakes have crept in again. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-14ospf6d: Convert to use builtin printf functionalityDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-03ospf6d: Don't advertise AS-External LSAs into stub arealynne
If area is a normal area and has adjacencies up and then the user changes the area to a stub area, the code was leaving existing AS-External LSAs in the database and was sending AS-External LSAs into the stub area causing the adjacency to stay in Ex-Start. With this change we now cleanup the AS-External LSAs that existed when area was not a stub and do not advertise AS-External LSAs into the stub area. Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2021-02-18ospf6d: Update logs that indicate why ospf6 adjacency is not coming up.lynne
Add more details to these logs to help make it easier to determine why ospf6 adjacency is not coming up. Also make these logs show up without having to turn on debug logging, again making it easier to debug the misconfiguration. Signed-off-by: Lynne Morrison <lynne@voltaio.net>
2020-11-03Merge pull request #7261 from Niral-Networks/niral_dev_vrf_ospf6Rafael Zalamena
ospf6d : Transformation changes for ospf6 vrf support.
2020-10-30ospf6d : Transformation changes for ospf6 vrf support.harios_niral
1. All the changes are related to handle ospf6 with different vrf. 2. The dependancy of global ospf6 is removed. Co-authored-by: Kaushik <kaushik@niralnetworks.com> Signed-off-by: harios_niral <hari@niralnetworks.com>
2020-10-29ospf6d: ifindex should not be a pointer for ospf6_sendmsgDonald Sharp
Let's cleanup the ospf6_sendmsg api and not pass in a pointer to the ifindex to use. It's an integer. Also remove the assert(*ifindex); We never use ifindex of 0 Signed-off-by: Donald Sharp <sharpd@nvidia.com>