Commit Graph

22862 Commits

Author SHA1 Message Date
Duncan Eastoe
e3490d1fa2 lib: restore blank line after show route header
In 5a3cf85391 the trailing empty line
following the "show ip(v6) route" header was removed. Restore it for
consistency.

Signed-off-by: Duncan Eastoe <duncan.eastoe@att.com>
2021-01-27 12:19:52 +00:00
Duncan Eastoe
ec20380c34 tests: more robust show route header stripping
In test_converge_protocols() use sed to match the "show ip(v6) route"
header and strip it, rather than using tail which requires hardcoding
the expected length of the header (which is subject to change).

Signed-off-by: Duncan Eastoe <duncan.eastoe@att.com>
2021-01-27 12:19:52 +00:00
Yash Ranjan
35aeb295ed ospf6d: Json support added for command "show ipv6 ospf6 interface prefix [json]"
Modify code to add JSON format output in show command
"show ipv6 ospf6 interface prefix" with proper formating

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
2021-01-26 20:06:02 -08:00
Yash Ranjan
eacd0828d4 ospf6d: Json support added for command "show ipv6 ospf6 route [json]"
Modify code to add JSON format output in show command
"show ipv6 ospf6 route [<intra-area|inter-area|external-1|
external-2|X:X::X:X|X:X::X:X/M|detail|summary>]"
with proper formating

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
2021-01-26 20:06:02 -08:00
Mark Stapp
504bb03736
Merge pull request #7935 from donaldsharp/ospf6_use_after_free
ospf6d: Track wait_timer and disable when needed
2021-01-26 16:04:24 -05:00
Donald Sharp
b2fd215b21
Merge pull request #7925 from opensourcerouting/watchfrr-netns
watchfrr: fix crash on missing optional argument
2021-01-26 15:31:04 -05:00
Donald Sharp
79fd1dc867
Merge pull request #7938 from mjstapp/fix_netlink_debugs
zebra: debug messages go under conditionals
2021-01-26 15:30:41 -05:00
Donald Sharp
6df6d7bdf1
Merge pull request #7368 from eololab/add-pidfile-in-frr.service
tools: add PIDFile option in frr.service
2021-01-26 13:29:26 -05:00
Mark Stapp
4c99d413e6 zebra: debug messages go under conditionals
Move a couple of unprotected debug calls in the netlink code
under DEBUG_KERNEL.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-01-26 12:29:39 -05:00
Patrick Ruddy
b5a9054d76
Merge pull request #7635 from AnuradhaKaruppiah/ead-evi-knobs
bgpd: add config knobs to disable rx and tx of ead-per-evi routes
2021-01-26 17:14:57 +00:00
Rafael Zalamena
53a78fc1d9 watchfrr: fix SA warning
`valid_command` now causes static analyzer complaints since it no
longer assumes `optarg` is non-NULL. If this was the case then
`valid_command` would return `false` (or 0) because it would mean the
string is empty and doesn't contain the '%s' it expects.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-01-26 14:13:07 -03:00
Mark Stapp
ab57fb1280
Merge pull request #7934 from donaldsharp/valgrind_cleanups
pimd: Prevent use after free
2021-01-26 10:55:35 -05:00
Donald Sharp
9ae41e3105 ospf6d: Track wait_timer and disable when needed
When removing ospfv3 from an interface that has been previously
put into wait state, there is a possible use after free of the
oi because the wait_timer could have been started for the interface.
This is because the wait_timer was not tracked by the interface
and we just created a thread for it without storing the thread
pointer.

Issue: #7932
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-26 08:13:44 -05:00
Donald Sharp
eaffe5e892 pimd: Prevent use after free
Valgrind is reporting this:
==22220== Invalid read of size 4
==22220==    at 0x11DC2B: pim_if_delete (pim_iface.c:215)
==22220==    by 0x11DD71: pim_if_terminate (pim_iface.c:76)
==22220==    by 0x128E03: pim_instance_terminate (pim_instance.c:66)
==22220==    by 0x128E03: pim_vrf_delete (pim_instance.c:159)
==22220==    by 0x48E0010: vrf_delete (vrf.c:251)
==22220==    by 0x48E0010: vrf_delete (vrf.c:225)
==22220==    by 0x48E02FE: vrf_terminate (vrf.c:551)
==22220==    by 0x149495: pim_terminate (pimd.c:142)
==22220==    by 0x13C61B: pim_sigint (pim_signals.c:44)
==22220==    by 0x48CF862: quagga_sigevent_process (sigevent.c:103)
==22220==    by 0x48DD324: thread_fetch (thread.c:1404)
==22220==    by 0x48A926A: frr_run (libfrr.c:1122)
==22220==    by 0x11B85E: main (pim_main.c:167)
==22220==  Address 0x5912160 is 1,200 bytes inside a block of size 1,624 free'd
==22220==    at 0x48369AB: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==22220==    by 0x128E52: pim_instance_terminate (pim_instance.c:74)
==22220==    by 0x128E52: pim_vrf_delete (pim_instance.c:159)
==22220==    by 0x48E0010: vrf_delete (vrf.c:251)
==22220==    by 0x48E0010: vrf_delete (vrf.c:225)
==22220==    by 0x48F1353: zclient_vrf_delete (zclient.c:1896)
==22220==    by 0x48F1353: zclient_read (zclient.c:3511)
==22220==    by 0x48DD826: thread_call (thread.c:1585)
==22220==    by 0x48A925F: frr_run (libfrr.c:1123)
==22220==    by 0x11B85E: main (pim_main.c:167)
==22220==  Block was alloc'd at
==22220==    at 0x4837B65: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==22220==    by 0x48ADA4F: qcalloc (memory.c:110)
==22220==    by 0x128B9B: pim_instance_init (pim_instance.c:82)
==22220==    by 0x128B9B: pim_vrf_new (pim_instance.c:142)
==22220==    by 0x48E0C5A: vrf_get (vrf.c:217)
==22220==    by 0x48F13C9: zclient_vrf_add (zclient.c:1863)
==22220==    by 0x48F13C9: zclient_read (zclient.c:3508)
==22220==    by 0x48DD826: thread_call (thread.c:1585)
==22220==    by 0x48A925F: frr_run (libfrr.c:1123)
==22220==    by 0x11B85E: main (pim_main.c:167)

On pim vrf deletion, ensure that the vrf->info pointers are NULL as well
as the free'd pim pointer for ->vrf is NULL as well.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-26 07:56:36 -05:00
Russ White
72bd11663f
Merge pull request #7676 from ton31337/fix/show_ip_bgp_summary_description_truncate
bgpd: Strip neighbors's description to 20 chars in show bgp summary
2021-01-26 07:43:45 -05:00
Russ White
1f6549e47a
Merge pull request #7898 from donaldsharp/pim_igmp_crash
pimd: Prevent crash with igmp only config
2021-01-26 07:39:58 -05:00
Russ White
aee697b454
Merge pull request #7901 from donaldsharp/pim_marking
tests: Fix to use global variable for pim marking
2021-01-26 07:39:02 -05:00
Russ White
044a731747
Merge pull request #7928 from volta-networks/fix_simple_snmp_add_checks
tests: update simple_snmp_test to check for memory leaks, router failure
2021-01-26 07:34:11 -05:00
Russ White
a9294a8cbd
Merge pull request #7127 from opensourcerouting/ospf_ti-lfa
ospfd: add support for Topology Independent LFA (TI-LFA)
2021-01-26 07:32:04 -05:00
Russ White
1e2daeeb1d
Merge pull request #7843 from volta-networks/feat_isis_attach_bit
isisd: Fix Attach-bit processing
2021-01-26 07:28:20 -05:00
ckishimo
2718dd0251 tests: support ospf6d area config
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-26 11:23:22 +01:00
ckishimo
12011c4015 tests: fix create_router_ospf6 to use ospf6 instead of ospf
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-26 11:19:38 +01:00
ckishimo
889da6763c tests: make __create_ospf_global for both ospfv2/3
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-26 11:15:19 +01:00
ckishimo
6c5fedcfd1 tests: remove unused __create_ospf6_global()
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-26 11:14:56 +01:00
ckishimo
a7394afa52 tests: create_interfaces_cfg add ospfv3 support
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-26 11:01:05 +01:00
ckishimo
3ee31ad131 tests: create_interfaces_cfg add ospf cost
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-26 10:57:06 +01:00
ckishimo
6e7f58da09 tests: create_interfaces_cfg refactor ospf
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-26 10:52:32 +01:00
Mark Stapp
ff6fd1cc8a
Merge pull request #7923 from donaldsharp/gcc10-cleanups
Gcc10 cleanups
2021-01-25 12:30:52 -05:00
Donald Sharp
431deca7ea
Merge pull request #7905 from mjstapp/fix_zapi_nhg
zebra, sharpd: async results for NHGs
2021-01-25 10:29:04 -05:00
Karen Schoener
662c057635 tests: update simple_snmp_test to check for memory leaks, router failure
Signed-off-by: Karen Schoener <karen@voltanet.io>
2021-01-25 10:01:24 -05:00
Donald Sharp
ea6caa1f52 lib: Wrapper a function to make gcc-10 happy
gcc-10 is complaining:

lib/frrscript.c:42:14: error: cast between incompatible function types from ‘const char * (*)(lua_State *, const char *)’ to ‘void (*)(lua_State *, const void *)’ [-Werror=cast-function-type]
   42 |   .encoder = (encoder_func)lua_pushstring,
      |              ^

Wrapper it to make it happy.  Not sure what else to do.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-25 09:15:36 -05:00
Donald Sharp
833c1f9fd1 lib: Prevent possible memory overwrite
fname is MAXPATHLEN and scriptdir and fs->name are less then
MAXPATHLEN but the combination of those two + the `.lua` are
greater than the MAXPATHLEN.  Just give us more room to prevent
a coding boo boo.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-25 09:15:36 -05:00
Donald Sharp
8f17f6eb2d ospf6d: use a new json_object per loop iteration
When redistributing multiple route types into ospfv3
the code must create a new array per route type into
the the json code.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-25 09:15:36 -05:00
Donald Sharp
4912deafad
Merge pull request #7922 from ton31337/fix/bgpd_blackhole_community_ibgp
bgpd: Advertise BLACKHOLE community tagged prefixes to iBGP peers
2021-01-25 07:22:39 -05:00
Rafael Zalamena
b12bc77cd3 watchfrr: fix crash on missing optional argument
Fix `netns` command line handling for missing argument (it's optional).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-01-25 08:33:01 -03:00
Donatas Abraitis
b4efa101a8 bgpd: Assert that community_str2com("no-export") always returns non-NULL
community_str2com("no-export"); returns ALWAYS non-NULL.

If NULL returned here, we really have a bigger problems in the call path.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-01-25 09:51:22 +02:00
Donatas Abraitis
a5de4a566d tests: Check if BLACKHOLE community prefixes are visible inside local AS
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-01-25 09:11:01 +02:00
Donatas Abraitis
aade37d727 bgpd: Set no-export community for blackhole tagged prefixes
RFC says to prevent propagation of the prefix outside the local AS.

So, let's use NO_EXPORT.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-01-25 09:09:37 +02:00
Donatas Abraitis
9e2912897d bgpd: Log prefix when community filter fails
This is needed when NO_ADVERTISE or NO_EXPORT is handled for outgoing
updates.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-01-24 10:48:41 +02:00
Donatas Abraitis
e1b49f5da7
Merge pull request #7890 from wesleycoakley/docker-fixups
docker: builder fixups
2021-01-23 16:41:31 +02:00
Mark Stapp
ee94437e28 zebra: send async nhg update results
Send the results of daemons' nhg updates asynchronously,
after the update has actually completed. Capture additional
info about the source daemon in order to locate the correct
zapi session. Simplify the result types considered by the
zebra_nhg module.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-01-22 16:33:01 -05:00
Donald Sharp
7ed8fcff2b tests: Fix to use global variable for pim marking
Use the preferred methodology of marking
for pim tests and update new pim tests with
appropriate mark

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-22 15:54:31 -05:00
Donald Sharp
86fc0eb7d8
Merge pull request #7911 from opensourcerouting/topotest-marker2
doc: fixed confusing examples in topotest marker doc
2021-01-22 15:50:32 -05:00
Mark Stapp
284c5a4584
Merge pull request #7906 from donaldsharp/sig_abrt
lib: Allow us to catch abort and do some small cleanup
2021-01-22 15:33:27 -05:00
David Schweizer
c8bcb7bd37
doc: fixed confusing statements in topotest marker doc
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-01-22 15:14:18 +01:00
Donald Sharp
f939c3a69f
Merge pull request #7899 from ton31337/fix/bgpd_blackhole_community
bgpd: Massage Blackhole community
2021-01-22 08:36:27 -05:00
Donald Sharp
75691bb7c4
Merge pull request #7904 from volta-networks/fix_test_oid_walk
tests: update snmp test infastructure api test_oid_walk
2021-01-22 08:32:39 -05:00
Donald Sharp
ddbda04e87
Merge pull request #7909 from pjdruddy/snmp-skip-test
test: add snmp skip test
2021-01-22 08:23:56 -05:00
Donald Sharp
f95224c170
Merge pull request #7902 from opensourcerouting/topotest-marker
tests: Standardized Topotest PyTest Markers
2021-01-22 08:23:02 -05:00
Mark Stapp
fb06b39ca8
Merge pull request #7854 from patrasar/2606829
bgpd : multiple memory leak fixes in show commands
2021-01-22 08:21:27 -05:00