Commit Graph

19747 Commits

Author SHA1 Message Date
Donald Sharp
e1c511c694 ospfd: Limit possible message read to our buffer size
It's possible(but unlikely) that a read of data from the
network will give us bogus data.  Don't automatically
just trust the data size from the network and limit
the read to the size of the buffer we have in play.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-22 07:31:07 -04:00
Donald Sharp
58c3cdb922 zebra: Cleanup dead code
There are a couple of switch statements in netlink_route_info_encode
in zebra_fpm_netlink.c that had logically dead code.  We have
a switch statement let's take actual advantage of it instead
of doing gyrations to what we want.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-22 07:29:15 -04:00
Donald Sharp
7952857590
Merge pull request #6268 from opensourcerouting/atomlist-cxx-compat
lib: make atomlist code C++ compatible
2020-04-22 07:28:43 -04:00
Philippe Guibert
3255e756a2 bgpd: handle fs nlri over 240 bytes
the nlri flowspec above 240 bytes size was not handled.
Over 240 bytes, the length is 2 bytes length, and a calculation must be
done to obtain the real length. This commit handles it appropriately.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-04-22 12:12:03 +02:00
Donatas Abraitis
4c60e50f7f
Merge pull request #6191 from NaveenThanikachalam/ibgp_connected
bgpd: Enforce self-next-hop check in next-hop update.
2020-04-21 23:16:03 +03:00
Donald Sharp
bda96cdd33
Merge pull request #6126 from sarav511/watermark
pimd: Implement watermark warning for igmp group count and add igmp group count
2020-04-21 16:14:21 -04:00
David Lamparter
6127ec9752 lib/frrcu: make C++ compatible
... by dropping seqlock.h from the header's includes;  it's only needed
in the C code in frrcu.c.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-21 21:38:07 +02:00
David Lamparter
5d6299d7da lib/atomlist: make C++ compatible
... by using `atomic_atomptr_t`.  Other ideas seemed worse.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-21 21:38:07 +02:00
Quentin Young
64fbc17e51
Merge pull request #6267 from mjstapp/fix_ospf6_unlock_sa
ospf6d: fix SA warnings
2020-04-21 14:31:56 -04:00
Quentin Young
0880854185 pimd, lib: suppress compiler warnings on snprintf
truncation warnings on old compilers

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-21 13:13:06 -04:00
Quentin Young
e15361b322
Merge pull request #6253 from opensourcerouting/fpm-extra
zebra/fpm: fix shutdown and add more documentation
2020-04-21 11:28:05 -04:00
Donald Sharp
af4c0040f1
Merge pull request #6264 from opensourcerouting/doc-workflow-20200420
doc: workflow updates
2020-04-21 11:16:24 -04:00
Mark Stapp
4b0e09d878 ospf6d: fix SA warnings
Clean up some SA warnings in use of ospf6_lsa_unlock()

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-04-21 11:01:18 -04:00
Russ White
e805a969ac
Merge pull request #6147 from opensourcerouting/ldpd-broken-lsps
ldpd: don't drop packets coming through a broken LSP
2020-04-21 09:08:06 -04:00
David Lamparter
70aa675d6c doc: add some Github workflow notes
Just writing down what seems to be established procedure.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-21 03:31:02 +02:00
David Lamparter
08cffeb5d9 doc: document strcpy & sprintf ban
Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-21 03:30:59 +02:00
Quentin Young
4ced1a2cb3 bgpd, isis, tools: style fixen
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-20 19:15:35 -04:00
Quentin Young
2b7165e76f *: use appropriate buffer sizes, specifiers
- Fix 1 byte overflow when showing GR info in bgpd
- Use PATH_MAX for path buffers
- Use unsigned specifiers for uint16_t's in zebra pbr

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-20 19:14:33 -04:00
Quentin Young
fc746f1c01 *: manually remove some more sprintf
Take care of some more complicated cases by hand

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-20 19:14:33 -04:00
Quentin Young
772270f3b6 *: sprintf -> snprintf
Replace sprintf with snprintf where straightforward to do so.

- sprintf's into local scope buffers of known size are replaced with the
  equivalent snprintf call
- snprintf's into local scope buffers of known size that use the buffer
  size expression now use sizeof(buffer)
- sprintf(buf + strlen(buf), ...) replaced with snprintf() into temp
  buffer followed by strlcat

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-20 19:14:33 -04:00
Quentin Young
3f0cc3ffb3 tools: add more macros to cocci.h
Coccinelle needs to know about complicated macros to understand certain
code paths, add some more macros there.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-20 19:14:33 -04:00
Quentin Young
70395c6fd5
Merge pull request #6263 from opensourcerouting/zlog-coverity-20200420
lib/zlog: fix coverity warning
2020-04-20 19:12:50 -04:00
David Lamparter
d35c30ca9d doc: remove mailing list patch submission
Last patch sent in on the mailing list was in July 2018.  If someone
sends a patch we can still pick it up, but practiced reality is quite
clearly PRs on github.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-20 23:20:13 +02:00
David Lamparter
41051697a9 lib/zlog: fix coverity warning
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-20 23:17:17 +02:00
Donald Sharp
73f079b589
Merge pull request #6261 from ton31337/fix/allow_nhlen_32
bgpd: Do not discard an UPDATE if the global nexthop is set to ::
2020-04-20 16:10:07 -04:00
Donald Sharp
2d3d652178
Merge pull request #6251 from opensourcerouting/cs-ignore
*: make coverity scan ignore random() calls
2020-04-20 16:08:37 -04:00
Mark Stapp
e4195c02a7
Merge pull request #6245 from sworleys/NHG-More-Topo
tests: add connected/recursive/duplicte/route-map NHG tests
2020-04-20 13:28:14 -04:00
Donatas Abraitis
0355b41d84 bgpd: Do not discard an UPDATE if the global nexthop is set to ::
When we receive an UPDATE with MP_NEXTHOP len as 32 bytes, we shouldn't
check if the global (1st) nexthop is unspecified.

Peering between bird and FRRouting we receive from Bird something like:
```
rcvd UPDATE w/ attr: , origin i, mp_nexthop ::(fe80::a00:27ff:fe09:f8a3)
```
The link-local (2nd) nexthop is valid and validated later in the code.

Before it was marked:
```
IPv6 unicast -- DENIED due to: martian or self next-hop;
```

After it's a valid prefix:
```
spine1-debian-9# show bgp
BGP table version is 0, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 65002
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
   2a02:4780::/64   fe80::a00:27ff:fe09:f8a3
                                                           0 65001 i

Displayed  1 routes and 1 total paths
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-20 18:59:15 +03:00
Donald Sharp
3c2fdd64c0
Merge pull request #6260 from ton31337/fix/01_to_bool
bgpd: Use true/false for reject_as_sets
2020-04-20 08:30:28 -04:00
Donatas Abraitis
7f972cd8dc bgpd: Use true/false for reject_as_sets
Just remove MACROS and use true/false.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-20 12:59:52 +03:00
Donatas Abraitis
b34b48cb3a
Merge pull request #6231 from dslicenc/v6-ra-hoplimit
zebra: add ability to set hoplimit for IPv6 RAs
2020-04-18 22:48:20 +03:00
Donald Sharp
8b1e4f30ba
Merge pull request #6164 from ton31337/feature/rfc8212_enabled_traditional_profile
bgpd: Enable rfc8212 by default except datacenter profile
2020-04-18 15:06:04 -04:00
David Lamparter
034cb57fd2
Merge pull request #6256 from qlyoung/pimd-no-strcpy 2020-04-18 20:47:32 +02:00
David Lamparter
7eea88e8c9
Merge pull request #6257 from qlyoung/bitfield-no-null-check-before-free 2020-04-18 17:34:09 +02:00
David Lamparter
c8eb691505
Merge pull request #6258 from donaldsharp/more_scan_more 2020-04-18 17:06:38 +02:00
Donald Sharp
744ba56969 ospf6d: Prevent use after free
ospf6_lsa_unlock may free the lsa data structure as such
we cannot use the passed in data structure after freeing it.

Provide a mechanism to know if the data has been freed
using the same usage patterns of other _unlock functions
in FRR.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-18 08:35:06 -04:00
Donald Sharp
16167b3146 isisd: Prevent use after free for isis_adj_state_change
When we call isis_adj_state_change with ISIS_ADJ_DOWN
we free the pointer, but we were still using the pointer
after it was freed.  Cleanup the api to prevent this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-18 08:30:33 -04:00
Quentin Young
1ac10b15b1 lib: dont null check bitfield pointer before free
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-17 20:19:38 -04:00
Quentin Young
1be1ca35c7
Merge pull request #6255 from mjstapp/fix_bitfield_free
lib: clear data pointer in bf_free
2020-04-17 20:17:18 -04:00
Quentin Young
1120b9596a lib: don't use strcpy
>:(

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-17 20:05:34 -04:00
Quentin Young
96e43299b4 pimd: don't use strcpy
>:(

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-17 19:59:02 -04:00
Rafael Zalamena
5920b3eb38 *: replace all random() calls
Replace all `random()` calls with a function called `frr_weak_random()`
and make it clear that it is only supposed to be used for weak random
applications.

Use the annotation described by the Coverity Scan documentation to
ignore `random()` call warnings.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-04-17 20:57:43 -03:00
Rafael Zalamena
98a8750481 zebra: gracefully shutdown fpm module
Lets stop and free all resources before shutting down.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-04-17 20:18:58 -03:00
Rafael Zalamena
6ba8db2186 zebra: notify data plane providers about shutdown
Call the `dp_fini` callback twice: once at the beginning of the shutdown
and then again right before `exit()`ing zebra.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-04-17 20:18:58 -03:00
Rafael Zalamena
9d73613388 doc: update FPM documentation
Tell users about new FPM implementation and add more documentation about
it.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-04-17 20:18:54 -03:00
Mark Stapp
193848fff6 lib: clear data pointer in bf_free
Help avoid double-free by clearing data pointer.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-04-17 16:53:37 -04:00
Donatas Abraitis
4110aa2cb3
Merge pull request #6248 from donaldsharp/zebra_snmp
some more coverity fixups
2020-04-17 12:09:58 +03:00
Sri Mohana Singamsetty
bece779c79
Merge pull request #6240 from ton31337/fix/null_bnc_bgp_show_hostname
bgpd: Add a sanitify check for bgp_nexthop_cache against NULL
2020-04-16 20:17:40 -07:00
Donald Sharp
85948e7bfa pimd: if_lookup_by_index can fail handle it appropriately
It is possible that a if_lookup_by_index can return NULL
ensure that we handle this appropriately.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-16 20:28:15 -04:00
Donald Sharp
50cf5243c1 lib: prefix must be a valid pointer at this point
Coverity does not understand how our CLI works.  Make it
happy that we have tested it's existence

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-16 20:17:22 -04:00