Donald Sharp
5775d4be08
Merge pull request #10356 from opensourcerouting/pim6-adjust-20220117
...
pim6d: conversion work batch
2022-02-16 09:53:48 -05:00
Donald Sharp
91b508dc2c
ripd: Cleanup ripd.c indentation levels and comments
...
The entirety of this file is heavily indented. Work some coding
structure to make it easier to read and understand and not be
so heavily indented.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-16 08:11:00 -05:00
Russ White
fbd44411ee
Merge pull request #10575 from donaldsharp/bgp_requires_policy
...
bgp: Add a 6 hour warning to missing policy
2022-02-15 21:33:16 -05:00
Donald Sharp
114918bd0b
ripd: Fix packet send for non primary addresses
...
When rip is configured to work on secondary addresses
on an interface, rip was not properly sending out
the packets on secondary addresses because the source of the
packet was never properly being setup and rip would
send the packet out multiple times for the primary address
not once for each address on the interface that is setup to work.
tcpdump + rip debugs output with fix:
2022/02/15 19:59:50 RIP: [ZG173-BHW0K] turn on virbr0
2022/02/15 19:59:51 RIP: [PYB7S-80D89] multicast join at virbr0
2022/02/15 19:59:51 RIP: [GZR24-FCQGG] multicast request on virbr0
2022/02/15 19:59:51 RIP: [JTNCV-XD8S1] rip_send_packet 192.168.122.1 > 224.0.0.9 (virbr0)
2022/02/15 19:59:51 RIP: [VEJY5-67P5X] SEND to 224.0.0.9520
2022/02/15 19:59:51 RIP: [JTNCV-XD8S1] rip_send_packet 73.3.3.8 > 224.0.0.9 (virbr0)
2022/02/15 19:59:51 RIP: [VEJY5-67P5X] SEND to 224.0.0.9520
19:59:51.831128 IP 192.168.122.1.route > rip2-routers.mcast.net.route: RIPv2, Request, length: 24
19:59:51.831161 IP c-73-3-3-8.hsd1.mo.comcast.net.route > rip2-routers.mcast.net.route: RIPv2, Request, length: 24
Fixes : #10588
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-15 20:02:21 -05:00
Punith Kumar
73e770b7ad
bgpd: Fix uninitialized compiler warning
...
Signed-off-by: Punith Kumar <punithkumar.spk@gmail.com>
2022-02-15 22:07:19 +00:00
Donald Sharp
e4aa4745f2
bgpd: Renumber bgp_create_error_code enum values
...
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-15 16:38:32 -05:00
Donald Sharp
4b7e23e9f2
bgpd: Convert bgp error codes for cli input to an enum
...
Conversion of bgp error codes returned for cli input into
an enum and then properly handling all the error cases
in bgp_vty_return.
Because not all error codes returned were properly handled
in this function there existed configuration examples that
were accepted on the cli without an error message but not
saved.
Fixes : #10589
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-15 16:38:32 -05:00
Donald Sharp
b5d6f2d068
bgpd: Remove unused BGP_ERR_MAX #define
...
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-15 16:38:32 -05:00
Donald Sharp
6dcea6fe05
bgpd: Move some error codes to bgp_vty_return handling
...
BGP_ERR_PEER_GROUP_MEMBER and BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT
both are not handled by bgp_vty_return, but both can be handled by
this function as that there is nothing special going on here.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-15 16:38:32 -05:00
Donald Sharp
8b4a0b6631
bgpd: Remove impossible invalid state
...
confederations are checking to see that the bgp pointer
is non-null. But it's impossible to have a null pointer
in the cli and in all paths we have already deref'ed the bgp
pointer. Let's remove that error code as that it is impossible
to happen.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-15 16:38:32 -05:00
Russ White
c07cfc5494
Merge pull request #10571 from rameshabhinay/ospf6_auth_trailer
...
ospf6d: fix coverity issues.
2022-02-15 13:19:48 -05:00
Russ White
8f689a6e8d
Merge pull request #10546 from ton31337/fix/check_for_null_inside_unintern
...
bgpd: Check for NULL inside aspath_unintern()
2022-02-15 12:59:45 -05:00
Russ White
17c93806a0
Merge pull request #10555 from anlancs/doc-comment
...
doc: add "cost" to ospfd "range" command
2022-02-15 12:58:28 -05:00
Russ White
02c29fab18
Merge pull request #10562 from donaldsharp/starv_warn
...
lib: Save number of times a thread is starved
2022-02-15 12:57:39 -05:00
Donald Sharp
b17826b715
bgp: Add a 15 minute warning to missing policy
...
Add a 15 minute warning to the logging system when
bgp policy is not setup properly. Operators keep asking
about the missing policy( on upgrade typically ). Let's
try to give them a bit more of a hint when something is
going wrong as that they are clearly missing the other
various places FRR tells them about it.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-15 12:40:38 -05:00
Donald Sharp
264274daed
doc: List DEFUN as deprecated
...
New development should use DEFPY. Document this
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-15 12:35:09 -05:00
Donald Sharp
e605a2391a
doc: Update documentation to state new code must use latest approved methods
...
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-15 12:35:09 -05:00
Russ White
f8e665084d
Merge pull request #10573 from ton31337/fix/doc_rc_tag
...
doc: An example how we do RC tagging for stabilization branch
2022-02-15 11:33:02 -05:00
anlan_cs
c0d217c4e8
pimd: remove redundant code
...
`ifchannel_rb` is already cleaned by `pim_ifchannel_delete_all`, so
it should be removed.
Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-02-15 22:49:37 +08:00
Donatas Abraitis
1e5c949d36
Merge pull request #10577 from donaldsharp/speeling
...
Speeling
2022-02-14 22:17:54 +02:00
Donald Sharp
b9d95135a8
zebra: Fix spelling mistake
...
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-14 12:56:44 -05:00
Donald Sharp
dfd4f44ffc
yang: Fix spelling mistake
...
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-14 12:56:21 -05:00
Donald Sharp
11743d1041
vtysh: Fix spelling mistakes
...
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-14 12:56:04 -05:00
Donald Sharp
e1f79be5ed
tests: Fix spelling and grammar mistakes
...
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-14 12:55:20 -05:00
Donald Sharp
3d05c4bdcb
pceplib: Fix spelling mistakes
...
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-14 12:54:05 -05:00
Donald Sharp
1373ad765a
pathd: Fix spelling mistakes
...
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-14 12:53:48 -05:00
Donald Sharp
1461559c24
ospfd: Fix spelling mistakes
...
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-14 12:53:16 -05:00
Donald Sharp
bbf5104c5b
ospf6d: Fix spelling mistakes
...
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-14 12:52:05 -05:00
Donald Sharp
e6f83fc56a
doc: Fix spelling mistakes
...
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-14 12:51:22 -05:00
Donald Sharp
1da3a6c69a
bgpd: Fix spelling mistakes
...
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-14 12:50:58 -05:00
Abhinay Ramesh
42bfee18c2
ospf6d: fix coverity issues.
...
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-14 06:36:02 +00:00
David Lamparter
29fd9fca45
pim6d: IPv6-adjust pim_msg_send() and related
...
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00
David Lamparter
2b844385dc
pim6d: IPv6-adjust pim_ifchannel_*
...
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00
David Lamparter
efd66f7bad
pim6d: IPv6-adjust assert-related addrs
...
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00
David Lamparter
da6bed2bbe
pim6d: IPv6-adjust jp_agg->group
...
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00
David Lamparter
034db86b72
pim6d: IPv6-adjust iface primary/DR addrs
...
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00
David Lamparter
01adb431d3
pim6d: IPv6-adjust pim_upstream addr
...
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00
David Lamparter
11928ecf19
pim6d: IPv6-adjust Hello/TLV processing
...
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00
David Lamparter
9bb93fa04e
pim6d: IPv6-adjust neigh->source_addr
...
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00
David Lamparter
c631920c15
pim6d: IPv6-adjust various pim_sgaddr uses
...
Since `pim_sgaddr` is `pim_addr` now, that causes a whole lot of fallout
anywhere S,G pairs are handled.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00
David Lamparter
80d9fa1e68
pim6d: prepare SSM/filter functions
...
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00
David Lamparter
5d99ebea32
pim6d: prepare/stub pim_rp_* functions for IPv6
...
These are sprinkled relatively widely through the PIM codebase, so for
the time being reduce the "compiler warning surface" by moving them
forward to proper types without actual implementations.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00
David Lamparter
0d36009204
pim6d: more TLV parse/encode IPv6 preparation
...
More proliferation of pim_addr to work towards IPV6.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00
David Lamparter
16763d77a3
pim6d: prepare IPv6 address encoding functions
...
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00
David Lamparter
883052c6f9
pim6d: convert address comparison in I_am_DR macro
...
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00
Donatas Abraitis
0a3fa828f8
doc: An example how we do RC tagging for stabilization branch
...
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-02-13 21:23:53 +02:00
Mark Stapp
348698095d
zebra: make netlink object hash threadsafe
...
The recently-added hashtable of nlsock objects needs to be
thread-safe: it's accessed from the main and dplane pthreads.
Add a mutex for it, use wrapper apis when accessing it. Add
a per-OS init/terminate api so we can do init that's not
per-vrf or per-namespace.
Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2022-02-11 17:03:26 -05:00
Jafar Al-Gharaibeh
d10b16499c
Merge pull request #10533 from taspelund/ip_rule_nl_debugs
...
zebra: add netlink debugs for ip rules
2022-02-11 11:37:40 -06:00
Donatas Abraitis
f7d8698313
Merge pull request #9697 from SaiGomathiN/igmp-sources
...
pimd: json support added
2022-02-11 07:53:02 +02:00
ron
1c7c9ba037
lib: not thread off when schedule
...
Signed-off-by: ron <lyq140hf2006@163.com>
2022-02-11 11:27:11 +08:00