Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: preparations for RFC5424 syslog support #8457

Closed
wants to merge 12 commits into from

Conversation

eqvinox
Copy link
Contributor

@eqvinox eqvinox commented Apr 13, 2021

This is all the preparatory commits for the upcoming RFC5424 PR which I'll open in a minute. This is split off because everything here should be ready to go regardless of polishing or adjustments on the RFC5424 bits.

The first 2 commits

  • lib: fix possible assert() fail in zlog_fd() (c239e0b)
  • lib: correctly exit CLI nodes on file config load (9a684f0)
    also need to be applied on 7.5 & 7.4. (The second one is kinda "meh", but the first one is a bit more "narf".)

Copy link

@polychaeta polychaeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution to FRR!

Click for style suggestions

To apply these suggestions:

curl -s https://gist.githubusercontent.com/polychaeta/9c4b0cb89b2d22f93413f014a60ac28b/raw/78502b2b184e4442536ea67fd638afd87f67c2cf/cr_8457_1618272570.diff | git apply

diff --git a/lib/log_vty.c b/lib/log_vty.c
index 69b155be2..860d13a57 100644
--- a/lib/log_vty.c
+++ b/lib/log_vty.c
@@ -596,13 +596,8 @@ DEFUN (no_config_log_filterfile,
 	return CMD_SUCCESS;
 }
 
-DEFPY (log_filter,
-       log_filter_cmd,
-       "[no] log filter-text WORD$filter",
-       NO_STR
-       "Logging control\n"
-       FILTER_LOG_STR
-       "String to filter by\n")
+DEFPY(log_filter, log_filter_cmd, "[no] log filter-text WORD$filter",
+      NO_STR "Logging control\n" FILTER_LOG_STR "String to filter by\n")
 {
 	int ret = 0;
 
@@ -625,24 +620,16 @@ DEFPY (log_filter,
 }
 
 /* Clear all log filters */
-DEFPY (log_filter_clear,
-       log_filter_clear_cmd,
-       "clear log filter-text",
-       CLEAR_STR
-       "Logging control\n"
-       FILTER_LOG_STR)
+DEFPY(log_filter_clear, log_filter_clear_cmd, "clear log filter-text",
+      CLEAR_STR "Logging control\n" FILTER_LOG_STR)
 {
 	zlog_filter_clear();
 	return CMD_SUCCESS;
 }
 
 /* Show log filter */
-DEFPY (show_log_filter,
-       show_log_filter_cmd,
-       "show logging filter-text",
-       SHOW_STR
-       "Show current logging configuration\n"
-       FILTER_LOG_STR)
+DEFPY(show_log_filter, show_log_filter_cmd, "show logging filter-text",
+      SHOW_STR "Show current logging configuration\n" FILTER_LOG_STR)
 {
 	char log_filters[ZLOG_FILTERS_MAX * (ZLOG_FILTER_LENGTH_MAX + 3)] = "";
 	int len = 0;
diff --git a/lib/zlog_targets.c b/lib/zlog_targets.c
index 8c609c907..708f341ee 100644
--- a/lib/zlog_targets.c
+++ b/lib/zlog_targets.c
@@ -120,8 +120,7 @@ void zlog_fd(struct zlog_target *zt, struct zlog_msg *msgs[], size_t nmsgs)
 		 *  - this being the last message in the batch
 		 *  - not enough remaining iov entries
 		 */
-		if (ts_buf + sizeof(ts_buf) - ts_pos < TS_LEN
-		    || i + 1 == nmsgs
+		if (ts_buf + sizeof(ts_buf) - ts_pos < TS_LEN || i + 1 == nmsgs
 		    || array_size(iov) - iovpos < 5) {
 			writev(fd, iov, iovpos);
 

If you are a new contributor to FRR, please see our contributing guidelines.

After making changes, you do not need to create a new PR. You should perform an amend or interactive rebase followed by a force push.

@LabN-CI
Copy link
Collaborator

LabN-CI commented Apr 13, 2021

Outdated results 💚

Basic BGPD CI results: SUCCESS, 0 tests failed

_ _
Result SUCCESS git merge/8457 8089b5e
Date 04/12/2021
Start 20:52:55
Finish 21:34:51
Run-Time 41:56
Total 1815
Pass 1815
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2021-04-12-20:52:55.txt
Log autoscript-2021-04-12-20:54:07.log.bz2
Memory 505 503 431

For details, please contact louberger

@eqvinox
Copy link
Contributor Author

eqvinox commented Apr 13, 2021

9a684f0 is breaking CI, investigating.

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Apr 13, 2021

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18356/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source / Pull Request: Successful

Building Stage: Successful

Basic Tests: Failed

Topotests Ubuntu 18.04 amd64 part 4: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TP4U1804AMD64-18356/test

Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 4:

2021-04-13 01:03:06,022 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 2535, in create_bgp_community_lists
    tgen, router, config_data, "bgp_community_list", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 629, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % Malformed community-list value
line 2: Failure to communicate[13] to bgpd, line: bgp community-list standard ANY permit 0:-1 



2021-04-13 01:03:06,194 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 2535, in create_bgp_community_lists
    tgen, router, config_data, "bgp_community_list", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 629, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % Malformed community-list value
line 2: Failure to communicate[13] to bgpd, line: bgp community-list standard ANY permit 0:65536 



2021-04-13 01:03:06,368 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 2535, in create_bgp_community_lists
    tgen, router, config_data, "bgp_community_list", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 629, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % Malformed community-list value
line 2: Failure to communicate[13] to bgpd, line: bgp large-community-list standard ANY permit 0:4294967296 



2021-04-13 01:03:06,564 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 2535, in create_bgp_community_lists
    tgen, router, config_data, "bgp_community_list", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 629, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % Malformed community-list value
line 2: Failure to communicate[13] to bgpd, line: bgp large-community-list standard ANY permit 0:-1:1 



2021-04-13 01:03:07,594 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 2535, in create_bgp_community_lists
    tgen, router, config_data, "bgp_community_list", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 629, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % Malformed community-list value
line 2: Failure to communicate[13] to bgpd, line: bgp large-community-list standard ANY permit 1:a:2 



2021-04-13 01:05:18,450 ERROR: assert failed at "bgp_large_community.test_bgp_large_community_topo_2/test_create_large_community_lists_with_no_attribute_values": Testcase test_create_large_community_lists_with_no_attribute_values : Failed 
   Error: True
assert True is not True

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18356/artifact/TP4U1804AMD64/ErrorLog/log_topotests.txt

Topotests Ubuntu 18.04 arm8 part 9: Failed (click for details) Topotests Ubuntu 18.04 arm8 part 9: No useful log found
Topotests Ubuntu 16.04 i386 part 4: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TP4U1604I386-18356/test

Topology Tests failed for Topotests Ubuntu 16.04 i386 part 4:

2021-04-13 02:46:19,600 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 2535, in create_bgp_community_lists
    tgen, router, config_data, "bgp_community_list", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 629, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % Malformed community-list value
line 2: Failure to communicate[13] to bgpd, line: bgp community-list standard ANY permit 0:-1 



2021-04-13 02:46:19,800 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 2535, in create_bgp_community_lists
    tgen, router, config_data, "bgp_community_list", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 629, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % Malformed community-list value
line 2: Failure to communicate[13] to bgpd, line: bgp community-list standard ANY permit 0:65536 



2021-04-13 02:46:20,000 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 2535, in create_bgp_community_lists
    tgen, router, config_data, "bgp_community_list", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 629, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % Malformed community-list value
line 2: Failure to communicate[13] to bgpd, line: bgp large-community-list standard ANY permit 0:4294967296 



2021-04-13 02:46:20,196 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 2535, in create_bgp_community_lists
    tgen, router, config_data, "bgp_community_list", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 629, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % Malformed community-list value
line 2: Failure to communicate[13] to bgpd, line: bgp large-community-list standard ANY permit 0:-1:1 



2021-04-13 02:46:21,427 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 2535, in create_bgp_community_lists
    tgen, router, config_data, "bgp_community_list", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 629, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % Malformed community-list value
line 2: Failure to communicate[13] to bgpd, line: bgp large-community-list standard ANY permit 1:a:2 



2021-04-13 02:48:45,238 ERROR: assert failed at "bgp_large_community.test_bgp_large_community_topo_2/test_create_large_community_lists_with_no_attribute_values": Testcase test_create_large_community_lists_with_no_attribute_values : Failed 
   Error: True
assert True is not True

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18356/artifact/TP4U1604I386/ErrorLog/log_topotests.txt

Topotests Ubuntu 18.04 arm8 part 4: Failed (click for details) Topotests Ubuntu 18.04 arm8 part 4: No useful log found
Topotests Ubuntu 18.04 amd64 part 9: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO9U18AMD64-18356/test

Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 9:

2021-04-13 00:55:14,162 WARNING: vtysh_cmd: failed to convert json output
2021-04-13 00:55:34,796 WARNING: vtysh_cmd: failed to convert json output
2021-04-13 01:05:15,325 ERROR: assert failed at "test_ospf_single_area/test_ospf_hello_tc10_p0": Testcase test_ospf_hello_tc10_p0 : Failed 
   Error: True
assert True is not True

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18356/artifact/TOPO9U18AMD64/ErrorLog/log_topotests.txt

Topotests Ubuntu 16.04 i386 part 9: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO9U16I386-18356/test

Topology Tests failed for Topotests Ubuntu 16.04 i386 part 9:

RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
2021-04-13 02:55:57,002 WARNING: vtysh_cmd: failed to convert json output
2021-04-13 02:56:19,872 WARNING: vtysh_cmd: failed to convert json output
2021-04-13 02:57:32,913 ERROR: r3: bgpd left a dead pidfile (pid=2802)
2021-04-13 03:06:37,860 ERROR: assert failed at "test_ospf_single_area/test_ospf_hello_tc10_p0": Testcase test_ospf_hello_tc10_p0 : Failed 
   Error: True
assert True is not True

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18356/artifact/TOPO9U16I386/ErrorLog/log_topotests.txt

Successful on other platforms/tests
  • Addresssanitizer topotests part 3
  • Addresssanitizer topotests part 1
  • IPv6 protocols on Ubuntu 18.04
  • Topotests Ubuntu 18.04 amd64 part 5
  • Topotests Ubuntu 18.04 amd64 part 3
  • IPv4 protocols on Ubuntu 18.04
  • Addresssanitizer topotests part 8
  • Topotests Ubuntu 18.04 arm8 part 6
  • Topotests Ubuntu 18.04 arm8 part 1
  • Addresssanitizer topotests part 6
  • Topotests Ubuntu 18.04 arm8 part 2
  • Topotests Ubuntu 16.04 i386 part 2
  • Topotests Ubuntu 16.04 i386 part 1
  • Debian 10 deb pkg check
  • Topotests Ubuntu 16.04 i386 part 0
  • Topotests Ubuntu 16.04 i386 part 6
  • Topotests Ubuntu 18.04 amd64 part 7
  • Ubuntu 20.04 deb pkg check
  • Topotests Ubuntu 16.04 i386 part 8
  • IPv4 ldp protocol on Ubuntu 18.04
  • Debian 9 deb pkg check
  • Topotests Ubuntu 16.04 i386 part 3
  • CentOS 7 rpm pkg check
  • Topotests Ubuntu 18.04 amd64 part 8
  • Addresssanitizer topotests part 2
  • Fedora 29 rpm pkg check
  • Topotests Ubuntu 18.04 arm8 part 3
  • Topotests Ubuntu 18.04 arm8 part 7
  • Addresssanitizer topotests part 9
  • Addresssanitizer topotests part 4
  • Topotests Ubuntu 16.04 i386 part 5
  • Ubuntu 16.04 deb pkg check
  • Topotests Ubuntu 18.04 amd64 part 0
  • Addresssanitizer topotests part 5
  • Topotests Ubuntu 18.04 amd64 part 2
  • Addresssanitizer topotests part 7
  • Topotests Ubuntu 18.04 arm8 part 8
  • Topotests Ubuntu 18.04 amd64 part 6
  • Topotests Ubuntu 18.04 arm8 part 0
  • Addresssanitizer topotests part 0
  • Topotests Ubuntu 18.04 arm8 part 5
  • Topotests Ubuntu 16.04 i386 part 7
  • Topotests Ubuntu 18.04 amd64 part 1
  • Ubuntu 18.04 deb pkg check
  • Static analyzer (clang)

Warnings Generated during build:

Checkout code: Successful with additional warnings
Topotests Ubuntu 18.04 amd64 part 4: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TP4U1804AMD64-18356/test

Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 4:

2021-04-13 01:03:06,022 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 2535, in create_bgp_community_lists
    tgen, router, config_data, "bgp_community_list", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 629, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % Malformed community-list value
line 2: Failure to communicate[13] to bgpd, line: bgp community-list standard ANY permit 0:-1 



2021-04-13 01:03:06,194 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 2535, in create_bgp_community_lists
    tgen, router, config_data, "bgp_community_list", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 629, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % Malformed community-list value
line 2: Failure to communicate[13] to bgpd, line: bgp community-list standard ANY permit 0:65536 



2021-04-13 01:03:06,368 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 2535, in create_bgp_community_lists
    tgen, router, config_data, "bgp_community_list", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 629, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % Malformed community-list value
line 2: Failure to communicate[13] to bgpd, line: bgp large-community-list standard ANY permit 0:4294967296 



2021-04-13 01:03:06,564 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 2535, in create_bgp_community_lists
    tgen, router, config_data, "bgp_community_list", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 629, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % Malformed community-list value
line 2: Failure to communicate[13] to bgpd, line: bgp large-community-list standard ANY permit 0:-1:1 



2021-04-13 01:03:07,594 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 2535, in create_bgp_community_lists
    tgen, router, config_data, "bgp_community_list", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1804AMD64/topotests/lib/common_config.py", line 629, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % Malformed community-list value
line 2: Failure to communicate[13] to bgpd, line: bgp large-community-list standard ANY permit 1:a:2 



2021-04-13 01:05:18,450 ERROR: assert failed at "bgp_large_community.test_bgp_large_community_topo_2/test_create_large_community_lists_with_no_attribute_values": Testcase test_create_large_community_lists_with_no_attribute_values : Failed 
   Error: True
assert True is not True

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18356/artifact/TP4U1804AMD64/ErrorLog/log_topotests.txt

Topotests Ubuntu 18.04 arm8 part 9: Failed (click for details) Topotests Ubuntu 18.04 arm8 part 9: No useful log found
Topotests Ubuntu 16.04 i386 part 4: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TP4U1604I386-18356/test

Topology Tests failed for Topotests Ubuntu 16.04 i386 part 4:

2021-04-13 02:46:19,600 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 2535, in create_bgp_community_lists
    tgen, router, config_data, "bgp_community_list", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 629, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % Malformed community-list value
line 2: Failure to communicate[13] to bgpd, line: bgp community-list standard ANY permit 0:-1 



2021-04-13 02:46:19,800 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 2535, in create_bgp_community_lists
    tgen, router, config_data, "bgp_community_list", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 629, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % Malformed community-list value
line 2: Failure to communicate[13] to bgpd, line: bgp community-list standard ANY permit 0:65536 



2021-04-13 02:46:20,000 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 2535, in create_bgp_community_lists
    tgen, router, config_data, "bgp_community_list", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 629, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % Malformed community-list value
line 2: Failure to communicate[13] to bgpd, line: bgp large-community-list standard ANY permit 0:4294967296 



2021-04-13 02:46:20,196 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 2535, in create_bgp_community_lists
    tgen, router, config_data, "bgp_community_list", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 629, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % Malformed community-list value
line 2: Failure to communicate[13] to bgpd, line: bgp large-community-list standard ANY permit 0:-1:1 



2021-04-13 02:46:21,427 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 2535, in create_bgp_community_lists
    tgen, router, config_data, "bgp_community_list", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP4U1604I386/topotests/lib/common_config.py", line 629, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % Malformed community-list value
line 2: Failure to communicate[13] to bgpd, line: bgp large-community-list standard ANY permit 1:a:2 



2021-04-13 02:48:45,238 ERROR: assert failed at "bgp_large_community.test_bgp_large_community_topo_2/test_create_large_community_lists_with_no_attribute_values": Testcase test_create_large_community_lists_with_no_attribute_values : Failed 
   Error: True
assert True is not True

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18356/artifact/TP4U1604I386/ErrorLog/log_topotests.txt

Topotests Ubuntu 18.04 arm8 part 4: Failed (click for details) Topotests Ubuntu 18.04 arm8 part 4: No useful log found
Topotests Ubuntu 18.04 amd64 part 9: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO9U18AMD64-18356/test

Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 9:

2021-04-13 00:55:14,162 WARNING: vtysh_cmd: failed to convert json output
2021-04-13 00:55:34,796 WARNING: vtysh_cmd: failed to convert json output
2021-04-13 01:05:15,325 ERROR: assert failed at "test_ospf_single_area/test_ospf_hello_tc10_p0": Testcase test_ospf_hello_tc10_p0 : Failed 
   Error: True
assert True is not True

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18356/artifact/TOPO9U18AMD64/ErrorLog/log_topotests.txt

Topotests Ubuntu 16.04 i386 part 9: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO9U16I386-18356/test

Topology Tests failed for Topotests Ubuntu 16.04 i386 part 9:

RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
2021-04-13 02:55:57,002 WARNING: vtysh_cmd: failed to convert json output
2021-04-13 02:56:19,872 WARNING: vtysh_cmd: failed to convert json output
2021-04-13 02:57:32,913 ERROR: r3: bgpd left a dead pidfile (pid=2802)
2021-04-13 03:06:37,860 ERROR: assert failed at "test_ospf_single_area/test_ospf_hello_tc10_p0": Testcase test_ospf_hello_tc10_p0 : Failed 
   Error: True
assert True is not True

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18356/artifact/TOPO9U16I386/ErrorLog/log_topotests.txt

Report for command.c | 2 issues
===============================================
< WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
< #1245: FILE: /tmp/f1-21391/command.c:1245:
Report for log_filter.c | 2 issues
===============================================
< ERROR: do not use assignment in if condition
< #139: FILE: /tmp/f1-21391/log_filter.c:139:
Report for log_vty.c | 2 issues
===============================================
< ERROR: "foo * bar" should be "foo *bar"
< #37: FILE: /tmp/f1-21391/log_vty.c:37:
Report for log_vty.h | 2 issues
===============================================
< ERROR: "foo * bar" should be "foo *bar"
< #43: FILE: /tmp/f1-21391/log_vty.h:43:

Copy link

@polychaeta polychaeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution to FRR!

Click for style suggestions

To apply these suggestions:

curl -s https://gist.githubusercontent.com/polychaeta/84ee0ae4e4c81ed1ccb29a324c13d44d/raw/5b121f30e409463cbcf12738149f48def3bb34ca/cr_8457_1618831302.diff | git apply

diff --git a/lib/log_vty.c b/lib/log_vty.c
index 1cf90697c..fb8ac1ef8 100644
--- a/lib/log_vty.c
+++ b/lib/log_vty.c
@@ -596,13 +596,8 @@ DEFUN (no_config_log_filterfile,
 	return CMD_SUCCESS;
 }
 
-DEFPY (log_filter,
-       log_filter_cmd,
-       "[no] log filter-text WORD$filter",
-       NO_STR
-       "Logging control\n"
-       FILTER_LOG_STR
-       "String to filter by\n")
+DEFPY(log_filter, log_filter_cmd, "[no] log filter-text WORD$filter",
+      NO_STR "Logging control\n" FILTER_LOG_STR "String to filter by\n")
 {
 	int ret = 0;
 
@@ -625,24 +620,16 @@ DEFPY (log_filter,
 }
 
 /* Clear all log filters */
-DEFPY (log_filter_clear,
-       log_filter_clear_cmd,
-       "clear log filter-text",
-       CLEAR_STR
-       "Logging control\n"
-       FILTER_LOG_STR)
+DEFPY(log_filter_clear, log_filter_clear_cmd, "clear log filter-text",
+      CLEAR_STR "Logging control\n" FILTER_LOG_STR)
 {
 	zlog_filter_clear();
 	return CMD_SUCCESS;
 }
 
 /* Show log filter */
-DEFPY (show_log_filter,
-       show_log_filter_cmd,
-       "show logging filter-text",
-       SHOW_STR
-       "Show current logging configuration\n"
-       FILTER_LOG_STR)
+DEFPY(show_log_filter, show_log_filter_cmd, "show logging filter-text",
+      SHOW_STR "Show current logging configuration\n" FILTER_LOG_STR)
 {
 	char log_filters[ZLOG_FILTERS_MAX * (ZLOG_FILTER_LENGTH_MAX + 3)] = "";
 	int len = 0;
diff --git a/lib/zlog_targets.c b/lib/zlog_targets.c
index 8c609c907..708f341ee 100644
--- a/lib/zlog_targets.c
+++ b/lib/zlog_targets.c
@@ -120,8 +120,7 @@ void zlog_fd(struct zlog_target *zt, struct zlog_msg *msgs[], size_t nmsgs)
 		 *  - this being the last message in the batch
 		 *  - not enough remaining iov entries
 		 */
-		if (ts_buf + sizeof(ts_buf) - ts_pos < TS_LEN
-		    || i + 1 == nmsgs
+		if (ts_buf + sizeof(ts_buf) - ts_pos < TS_LEN || i + 1 == nmsgs
 		    || array_size(iov) - iovpos < 5) {
 			writev(fd, iov, iovpos);
 

If you are a new contributor to FRR, please see our contributing guidelines.

After making changes, you do not need to create a new PR. You should perform an amend or interactive rebase followed by a force push.

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Apr 19, 2021

Continuous Integration Result: SUCCESSFUL

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18476/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Warnings Generated during build:

Checkout code: Successful with additional warnings
Report for command.c | 2 issues
===============================================
< WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
< #1245: FILE: /tmp/f1-12477/command.c:1245:
Report for log_filter.c | 2 issues
===============================================
< ERROR: do not use assignment in if condition
< #139: FILE: /tmp/f1-12477/log_filter.c:139:
Report for log_vty.c | 2 issues
===============================================
< ERROR: "foo * bar" should be "foo *bar"
< #37: FILE: /tmp/f1-12477/log_vty.c:37:
Report for log_vty.h | 2 issues
===============================================
< ERROR: "foo * bar" should be "foo *bar"
< #43: FILE: /tmp/f1-12477/log_vty.h:43:

CLANG Static Analyzer Summary

  • Github Pull Request 8457, comparing to Git base SHA 8d31c67
  • Base image data for Git 8d31c67 does not exist - compare skipped

6 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18476/artifact/shared/static_analysis/index.html

@eqvinox
Copy link
Contributor Author

eqvinox commented Apr 20, 2021

This should be ready to go now. No idea what to do about the Travis CI thing, the log just stops and even with logging in with my github account I can't click rerun on it (HTTP 403, so I'm missing some permissions?)

@eqvinox
Copy link
Contributor Author

eqvinox commented Apr 20, 2021

Also the first commit in this series is kinda high priority, while I haven't seen people run into the assert(), it can very well cause crashes in actual use & let's get the fix in?

@LabN-CI
Copy link
Collaborator

LabN-CI commented Apr 20, 2021

Outdated results 💚

Basic BGPD CI results: SUCCESS, 0 tests failed

_ _
Result SUCCESS git merge/8457 f0b961b
Date 04/20/2021
Start 00:44:01
Finish 01:25:18
Run-Time 41:17
Total 1815
Pass 1815
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2021-04-20-00:44:01.txt
Log autoscript-2021-04-20-00:45:11.log.bz2
Memory 507 480 431

For details, please contact louberger

Copy link

@polychaeta polychaeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution to FRR!

Click for style suggestions

To apply these suggestions:

curl -s https://gist.githubusercontent.com/polychaeta/7680eeeed969fed813ea5cec436a5f5d/raw/5b121f30e409463cbcf12738149f48def3bb34ca/cr_8457_1618919822.diff | git apply

diff --git a/lib/log_vty.c b/lib/log_vty.c
index 1cf90697c..fb8ac1ef8 100644
--- a/lib/log_vty.c
+++ b/lib/log_vty.c
@@ -596,13 +596,8 @@ DEFUN (no_config_log_filterfile,
 	return CMD_SUCCESS;
 }
 
-DEFPY (log_filter,
-       log_filter_cmd,
-       "[no] log filter-text WORD$filter",
-       NO_STR
-       "Logging control\n"
-       FILTER_LOG_STR
-       "String to filter by\n")
+DEFPY(log_filter, log_filter_cmd, "[no] log filter-text WORD$filter",
+      NO_STR "Logging control\n" FILTER_LOG_STR "String to filter by\n")
 {
 	int ret = 0;
 
@@ -625,24 +620,16 @@ DEFPY (log_filter,
 }
 
 /* Clear all log filters */
-DEFPY (log_filter_clear,
-       log_filter_clear_cmd,
-       "clear log filter-text",
-       CLEAR_STR
-       "Logging control\n"
-       FILTER_LOG_STR)
+DEFPY(log_filter_clear, log_filter_clear_cmd, "clear log filter-text",
+      CLEAR_STR "Logging control\n" FILTER_LOG_STR)
 {
 	zlog_filter_clear();
 	return CMD_SUCCESS;
 }
 
 /* Show log filter */
-DEFPY (show_log_filter,
-       show_log_filter_cmd,
-       "show logging filter-text",
-       SHOW_STR
-       "Show current logging configuration\n"
-       FILTER_LOG_STR)
+DEFPY(show_log_filter, show_log_filter_cmd, "show logging filter-text",
+      SHOW_STR "Show current logging configuration\n" FILTER_LOG_STR)
 {
 	char log_filters[ZLOG_FILTERS_MAX * (ZLOG_FILTER_LENGTH_MAX + 3)] = "";
 	int len = 0;
diff --git a/lib/zlog_targets.c b/lib/zlog_targets.c
index 8c609c907..708f341ee 100644
--- a/lib/zlog_targets.c
+++ b/lib/zlog_targets.c
@@ -120,8 +120,7 @@ void zlog_fd(struct zlog_target *zt, struct zlog_msg *msgs[], size_t nmsgs)
 		 *  - this being the last message in the batch
 		 *  - not enough remaining iov entries
 		 */
-		if (ts_buf + sizeof(ts_buf) - ts_pos < TS_LEN
-		    || i + 1 == nmsgs
+		if (ts_buf + sizeof(ts_buf) - ts_pos < TS_LEN || i + 1 == nmsgs
 		    || array_size(iov) - iovpos < 5) {
 			writev(fd, iov, iovpos);
 

If you are a new contributor to FRR, please see our contributing guidelines.

After making changes, you do not need to create a new PR. You should perform an amend or interactive rebase followed by a force push.

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Apr 20, 2021

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

Test incomplete. See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18505/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source / Pull Request: Successful

Building Stage: Successful

Basic Tests: Incomplete

Addresssanitizer topotests part 8: Incomplete (check logs for details)
Topotests Ubuntu 18.04 arm8 part 1: Failed (click for details) Topotests Ubuntu 18.04 arm8 part 1: No useful log found
Topotests Ubuntu 18.04 i386 part 6: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO6U18I386-18505/test

Topology Tests failed for Topotests Ubuntu 18.04 i386 part 6:

2021-04-20 14:45:35,363 ERROR: assert failed at "test_bgp_snmp_mplsvpn/test_r1_mplsvpn_perf_table": mplsL3VpnVrfPerfCurrNumRoutes shouold be 7 got 5
assert False
2021-04-20 14:45:40,265 ERROR: assert failed at "test_bgp_snmp_mplsvpn/test_r1_mplsvpn_rte_table": mplsL3VpnVrfRteInetCidrDest should be ['0A 05 05 05', '0A 07 07 07', 'C0 A8 22 00', 'C0 A8 64 00', 'C0 A8 64 00', 'C0 A8 C8 00', 'C0 A8 C8 00'] oids ['86.82.70.45.97.1.10.5.5.5.32.0.0.1.192.168.100.10', '86.82.70.45.97.1.10.7.7.7.32.0.0.1.192.168.200.10', '86.82.70.45.97.1.192.168.34.0.24.0.0.1.10.4.4.4', '86.82.70.45.97.1.192.168.100.0.24.0.0.1.192.168.100.10', '86.82.70.45.97.1.192.168.100.0.24.0.1.0', '86.82.70.45.97.1.192.168.200.0.24.0.0.1.192.168.200.10', '86.82.70.45.97.1.192.168.200.0.24.0.1.0'] full dict ({'86.82.70.45.97.1.192.168.100.0.24.0.0.0': 'C0 A8 64 00', '86.82.70.45.97.1.192.168.100.0.24.0.1.1.192.168.100.10': 'C0 A8 64 00', '86.82.70.45.97.1.10.5.5.5.32.0.0.1.192.168.100.10': '0A 05 05 05', '86.82.70.45.97.1.192.168.200.0.24.0.0.0': 'C0 A8 C8 00', '86.82.70.45.97.1.192.168.34.0.24.0.0.1.10.4.4.4': 'C0 A8 22 00'}, ['0A 05 05 05', 'C0 A8 22 00', 'C0 A8 64 00', 'C0 A8 64 00', 'C0 A8 C8 00']):
assert False
2021-04-20 14:45:40,645 ERROR: r2: zebra left a dead pidfile (pid=29361)
*** defaultIntf: warning: r1 has no interfaces

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18505/artifact/TOPO6U18I386/ErrorLog/log_topotests.txt

Addresssanitizer topotests part 8: Incomplete (check logs for details)
Topotests Ubuntu 18.04 arm8 part 1: Failed (click for details) Topotests Ubuntu 18.04 arm8 part 1: No useful log found
Topotests Ubuntu 18.04 i386 part 6: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO6U18I386-18505/test

Topology Tests failed for Topotests Ubuntu 18.04 i386 part 6:

2021-04-20 14:45:35,363 ERROR: assert failed at "test_bgp_snmp_mplsvpn/test_r1_mplsvpn_perf_table": mplsL3VpnVrfPerfCurrNumRoutes shouold be 7 got 5
assert False
2021-04-20 14:45:40,265 ERROR: assert failed at "test_bgp_snmp_mplsvpn/test_r1_mplsvpn_rte_table": mplsL3VpnVrfRteInetCidrDest should be ['0A 05 05 05', '0A 07 07 07', 'C0 A8 22 00', 'C0 A8 64 00', 'C0 A8 64 00', 'C0 A8 C8 00', 'C0 A8 C8 00'] oids ['86.82.70.45.97.1.10.5.5.5.32.0.0.1.192.168.100.10', '86.82.70.45.97.1.10.7.7.7.32.0.0.1.192.168.200.10', '86.82.70.45.97.1.192.168.34.0.24.0.0.1.10.4.4.4', '86.82.70.45.97.1.192.168.100.0.24.0.0.1.192.168.100.10', '86.82.70.45.97.1.192.168.100.0.24.0.1.0', '86.82.70.45.97.1.192.168.200.0.24.0.0.1.192.168.200.10', '86.82.70.45.97.1.192.168.200.0.24.0.1.0'] full dict ({'86.82.70.45.97.1.192.168.100.0.24.0.0.0': 'C0 A8 64 00', '86.82.70.45.97.1.192.168.100.0.24.0.1.1.192.168.100.10': 'C0 A8 64 00', '86.82.70.45.97.1.10.5.5.5.32.0.0.1.192.168.100.10': '0A 05 05 05', '86.82.70.45.97.1.192.168.200.0.24.0.0.0': 'C0 A8 C8 00', '86.82.70.45.97.1.192.168.34.0.24.0.0.1.10.4.4.4': 'C0 A8 22 00'}, ['0A 05 05 05', 'C0 A8 22 00', 'C0 A8 64 00', 'C0 A8 64 00', 'C0 A8 C8 00']):
assert False
2021-04-20 14:45:40,645 ERROR: r2: zebra left a dead pidfile (pid=29361)
*** defaultIntf: warning: r1 has no interfaces

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18505/artifact/TOPO6U18I386/ErrorLog/log_topotests.txt

Addresssanitizer topotests part 7: Incomplete (check logs for details)
Addresssanitizer topotests part 8: Incomplete (check logs for details)
Topotests Ubuntu 18.04 arm8 part 1: Failed (click for details) Topotests Ubuntu 18.04 arm8 part 1: No useful log found
Topotests Ubuntu 18.04 i386 part 6: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO6U18I386-18505/test

Topology Tests failed for Topotests Ubuntu 18.04 i386 part 6:

2021-04-20 14:45:35,363 ERROR: assert failed at "test_bgp_snmp_mplsvpn/test_r1_mplsvpn_perf_table": mplsL3VpnVrfPerfCurrNumRoutes shouold be 7 got 5
assert False
2021-04-20 14:45:40,265 ERROR: assert failed at "test_bgp_snmp_mplsvpn/test_r1_mplsvpn_rte_table": mplsL3VpnVrfRteInetCidrDest should be ['0A 05 05 05', '0A 07 07 07', 'C0 A8 22 00', 'C0 A8 64 00', 'C0 A8 64 00', 'C0 A8 C8 00', 'C0 A8 C8 00'] oids ['86.82.70.45.97.1.10.5.5.5.32.0.0.1.192.168.100.10', '86.82.70.45.97.1.10.7.7.7.32.0.0.1.192.168.200.10', '86.82.70.45.97.1.192.168.34.0.24.0.0.1.10.4.4.4', '86.82.70.45.97.1.192.168.100.0.24.0.0.1.192.168.100.10', '86.82.70.45.97.1.192.168.100.0.24.0.1.0', '86.82.70.45.97.1.192.168.200.0.24.0.0.1.192.168.200.10', '86.82.70.45.97.1.192.168.200.0.24.0.1.0'] full dict ({'86.82.70.45.97.1.192.168.100.0.24.0.0.0': 'C0 A8 64 00', '86.82.70.45.97.1.192.168.100.0.24.0.1.1.192.168.100.10': 'C0 A8 64 00', '86.82.70.45.97.1.10.5.5.5.32.0.0.1.192.168.100.10': '0A 05 05 05', '86.82.70.45.97.1.192.168.200.0.24.0.0.0': 'C0 A8 C8 00', '86.82.70.45.97.1.192.168.34.0.24.0.0.1.10.4.4.4': 'C0 A8 22 00'}, ['0A 05 05 05', 'C0 A8 22 00', 'C0 A8 64 00', 'C0 A8 64 00', 'C0 A8 C8 00']):
assert False
2021-04-20 14:45:40,645 ERROR: r2: zebra left a dead pidfile (pid=29361)
*** defaultIntf: warning: r1 has no interfaces

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18505/artifact/TOPO6U18I386/ErrorLog/log_topotests.txt

Addresssanitizer topotests part 8: Incomplete (check logs for details)
Topotests Ubuntu 18.04 arm8 part 1: Failed (click for details) Topotests Ubuntu 18.04 arm8 part 1: No useful log found
Topotests Ubuntu 18.04 i386 part 6: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO6U18I386-18505/test

Topology Tests failed for Topotests Ubuntu 18.04 i386 part 6:

2021-04-20 14:45:35,363 ERROR: assert failed at "test_bgp_snmp_mplsvpn/test_r1_mplsvpn_perf_table": mplsL3VpnVrfPerfCurrNumRoutes shouold be 7 got 5
assert False
2021-04-20 14:45:40,265 ERROR: assert failed at "test_bgp_snmp_mplsvpn/test_r1_mplsvpn_rte_table": mplsL3VpnVrfRteInetCidrDest should be ['0A 05 05 05', '0A 07 07 07', 'C0 A8 22 00', 'C0 A8 64 00', 'C0 A8 64 00', 'C0 A8 C8 00', 'C0 A8 C8 00'] oids ['86.82.70.45.97.1.10.5.5.5.32.0.0.1.192.168.100.10', '86.82.70.45.97.1.10.7.7.7.32.0.0.1.192.168.200.10', '86.82.70.45.97.1.192.168.34.0.24.0.0.1.10.4.4.4', '86.82.70.45.97.1.192.168.100.0.24.0.0.1.192.168.100.10', '86.82.70.45.97.1.192.168.100.0.24.0.1.0', '86.82.70.45.97.1.192.168.200.0.24.0.0.1.192.168.200.10', '86.82.70.45.97.1.192.168.200.0.24.0.1.0'] full dict ({'86.82.70.45.97.1.192.168.100.0.24.0.0.0': 'C0 A8 64 00', '86.82.70.45.97.1.192.168.100.0.24.0.1.1.192.168.100.10': 'C0 A8 64 00', '86.82.70.45.97.1.10.5.5.5.32.0.0.1.192.168.100.10': '0A 05 05 05', '86.82.70.45.97.1.192.168.200.0.24.0.0.0': 'C0 A8 C8 00', '86.82.70.45.97.1.192.168.34.0.24.0.0.1.10.4.4.4': 'C0 A8 22 00'}, ['0A 05 05 05', 'C0 A8 22 00', 'C0 A8 64 00', 'C0 A8 64 00', 'C0 A8 C8 00']):
assert False
2021-04-20 14:45:40,645 ERROR: r2: zebra left a dead pidfile (pid=29361)
*** defaultIntf: warning: r1 has no interfaces

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18505/artifact/TOPO6U18I386/ErrorLog/log_topotests.txt

Addresssanitizer topotests part 7: Incomplete (check logs for details)
Addresssanitizer topotests part 5: Incomplete (check logs for details)
Successful on other platforms/tests
  • Topotests Ubuntu 18.04 arm8 part 8
  • Topotests Ubuntu 18.04 i386 part 1
  • Topotests Ubuntu 18.04 arm8 part 6
  • Topotests debian 10 amd64 part 7
  • IPv4 protocols on Ubuntu 18.04
  • Debian 10 deb pkg check
  • Topotests debian 10 amd64 part 8
  • Topotests debian 10 amd64 part 3
  • Topotests debian 10 amd64 part 2
  • Ubuntu 16.04 deb pkg check
  • Addresssanitizer topotests part 6
  • Topotests Ubuntu 18.04 amd64 part 6
  • Topotests Ubuntu 18.04 amd64 part 5
  • Topotests debian 10 amd64 part 1
  • IPv4 ldp protocol on Ubuntu 18.04
  • Addresssanitizer topotests part 2
  • Ubuntu 20.04 deb pkg check
  • Topotests Ubuntu 18.04 i386 part 0
  • Topotests debian 10 amd64 part 9
  • Topotests Ubuntu 18.04 i386 part 5
  • Debian 9 deb pkg check
  • Addresssanitizer topotests part 3
  • Topotests Ubuntu 18.04 amd64 part 8
  • Topotests Ubuntu 18.04 arm8 part 2
  • Addresssanitizer topotests part 9
  • Topotests Ubuntu 18.04 arm8 part 7
  • Topotests debian 10 amd64 part 0
  • Topotests Ubuntu 18.04 i386 part 8
  • Topotests Ubuntu 18.04 arm8 part 9
  • Topotests Ubuntu 18.04 arm8 part 4
  • Static analyzer (clang)
  • Topotests Ubuntu 18.04 amd64 part 7
  • Topotests Ubuntu 18.04 amd64 part 9
  • Fedora 29 rpm pkg check
  • Topotests Ubuntu 18.04 arm8 part 5
  • Topotests Ubuntu 18.04 arm8 part 0
  • Topotests Ubuntu 18.04 i386 part 7
  • Addresssanitizer topotests part 0
  • Topotests debian 10 amd64 part 6
  • Addresssanitizer topotests part 4
  • Topotests Ubuntu 18.04 amd64 part 4
  • Ubuntu 18.04 deb pkg check
  • Topotests Ubuntu 18.04 amd64 part 1
  • Topotests debian 10 amd64 part 4
  • Topotests Ubuntu 18.04 i386 part 2
  • CentOS 7 rpm pkg check
  • Topotests Ubuntu 18.04 amd64 part 2
  • IPv6 protocols on Ubuntu 18.04
  • Topotests Ubuntu 18.04 i386 part 9
  • Topotests Ubuntu 18.04 amd64 part 0
  • Topotests Ubuntu 18.04 i386 part 4
  • Topotests Ubuntu 18.04 arm8 part 3
  • Topotests Ubuntu 18.04 amd64 part 3
  • Addresssanitizer topotests part 1
  • Topotests debian 10 amd64 part 5

@LabN-CI
Copy link
Collaborator

LabN-CI commented Apr 20, 2021

Outdated results 💚

Basic BGPD CI results: SUCCESS, 0 tests failed

_ _
Result SUCCESS git merge/8457 77d1be3
Date 04/20/2021
Start 12:33:40
Finish 13:14:45
Run-Time 41:05
Total 1815
Pass 1815
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2021-04-20-12:33:40.txt
Log autoscript-2021-04-20-12:34:49.log.bz2
Memory 502 502 429

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Apr 20, 2021

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

Test incomplete. See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18505/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source / Pull Request: Successful

Building Stage: Successful

Basic Tests: Incomplete

Addresssanitizer topotests part 8: Incomplete (check logs for details)
Addresssanitizer topotests part 8: Incomplete (check logs for details)
Addresssanitizer topotests part 7: Incomplete (check logs for details)
Successful on other platforms/tests
  • Topotests Ubuntu 18.04 arm8 part 8
  • Topotests Ubuntu 18.04 i386 part 1
  • Topotests Ubuntu 18.04 arm8 part 6
  • Topotests debian 10 amd64 part 7
  • IPv4 protocols on Ubuntu 18.04
  • Topotests Ubuntu 18.04 arm8 part 1
  • Debian 10 deb pkg check
  • Topotests debian 10 amd64 part 8
  • Topotests debian 10 amd64 part 3
  • Topotests debian 10 amd64 part 2
  • Ubuntu 16.04 deb pkg check
  • Addresssanitizer topotests part 6
  • Topotests Ubuntu 18.04 amd64 part 6
  • Topotests Ubuntu 18.04 amd64 part 5
  • Topotests Ubuntu 18.04 i386 part 6
  • Topotests debian 10 amd64 part 1
  • IPv4 ldp protocol on Ubuntu 18.04
  • Addresssanitizer topotests part 2
  • Ubuntu 20.04 deb pkg check
  • Topotests Ubuntu 18.04 i386 part 0
  • Topotests debian 10 amd64 part 9
  • Topotests Ubuntu 18.04 i386 part 5
  • Debian 9 deb pkg check
  • Addresssanitizer topotests part 3
  • Topotests Ubuntu 18.04 amd64 part 8
  • Topotests Ubuntu 18.04 arm8 part 2
  • Addresssanitizer topotests part 9
  • Topotests Ubuntu 18.04 arm8 part 7
  • Topotests debian 10 amd64 part 0
  • Topotests Ubuntu 18.04 i386 part 8
  • Topotests Ubuntu 18.04 arm8 part 9
  • Topotests Ubuntu 18.04 arm8 part 4
  • Static analyzer (clang)
  • Addresssanitizer topotests part 5
  • Topotests Ubuntu 18.04 amd64 part 7
  • Topotests Ubuntu 18.04 amd64 part 9
  • Fedora 29 rpm pkg check
  • Topotests Ubuntu 18.04 arm8 part 5
  • Topotests Ubuntu 18.04 arm8 part 0
  • Topotests Ubuntu 18.04 i386 part 7
  • Addresssanitizer topotests part 0
  • Topotests debian 10 amd64 part 6
  • Addresssanitizer topotests part 4
  • Topotests Ubuntu 18.04 amd64 part 4
  • Ubuntu 18.04 deb pkg check
  • Topotests Ubuntu 18.04 amd64 part 1
  • Topotests debian 10 amd64 part 4
  • Topotests Ubuntu 18.04 i386 part 2
  • CentOS 7 rpm pkg check
  • Topotests Ubuntu 18.04 amd64 part 2
  • IPv6 protocols on Ubuntu 18.04
  • Topotests Ubuntu 18.04 i386 part 9
  • Topotests Ubuntu 18.04 amd64 part 0
  • Topotests Ubuntu 18.04 i386 part 4
  • Topotests Ubuntu 18.04 arm8 part 3
  • Topotests Ubuntu 18.04 amd64 part 3
  • Addresssanitizer topotests part 1
  • Topotests debian 10 amd64 part 5

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Apr 20, 2021

Continuous Integration Result: SUCCESSFUL

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18505/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Warnings Generated during build:

Checkout code: Successful with additional warnings
Report for command.c | 2 issues
===============================================
< WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
< #1245: FILE: /tmp/f1-1252/command.c:1245:
Report for log_filter.c | 2 issues
===============================================
< ERROR: do not use assignment in if condition
< #139: FILE: /tmp/f1-1252/log_filter.c:139:
Report for log_vty.c | 2 issues
===============================================
< ERROR: "foo * bar" should be "foo *bar"
< #37: FILE: /tmp/f1-1252/log_vty.c:37:
Report for log_vty.h | 2 issues
===============================================
< ERROR: "foo * bar" should be "foo *bar"
< #43: FILE: /tmp/f1-1252/log_vty.h:43:

CLANG Static Analyzer Summary

  • Github Pull Request 8457, comparing to Git base SHA 7408af7
  • Base image data for Git 7408af7 does not exist - compare skipped

6 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18505/artifact/shared/static_analysis/index.html

eqvinox added 10 commits April 21, 2021 16:25
If the last message in a batched logging operation isn't printed due to
priority, this skips the code that flushes prepared messages through
writev() and can trigger the assert() at the end of zlog_fd().

Since any logmsg above info priority triggers a buffer flush, running
into this situation requires a log file target configured for info
priority, at least 1 message of info priority buffered, a debug message
buffered after that, and then a buffer flush (explicit or due to buffer
full).

I haven't seen this chain of events happen in the wild, but it needs
fixing anyway.

Signed-off-by: David Lamparter <equinox@diac24.net>
The (legacy) code for reading split configs tries to execute config
commands in parent nodes, but doesn't call the node_exit function when
it goes up to a parent node.  This breaks BGP RPKI setup (and extended
syslog, which is in the next commit.)

Doing this correctly is a slight bit involved since the node_exit
callbacks should only be called if the command is actually executed on a
parent node.

Signed-off-by: David Lamparter <equinox@diac24.net>
`log-filter WORD` was giving me a serious headache since it also matches
`log WORD` due to the way the CLI token handling works.  This meant that
a mistyped `log something` command would silently be interpreted as a
filter string, causing me serious headscratching and WTFs until I
figured what was going on.

Remove this UX pitfall so noone else falls into it.  (Since the command
was never saved to config, renaming it shouldn't cause trouble.)

[Also I apparently forgot to update the docs when I transferred this
over to the new zlog bits...]

TODO for a rainy day:  since we collect all the CLI commands anyway, we
should warn somewhere for "2nd level ambiguous" commands like this.

Signed-off-by: David Lamparter <equinox@diac24.net>
... so additional targets can print their state.

Signed-off-by: David Lamparter <equinox@diac24.net>
printfrr() recently acquired the capability to record start/end of
formatting outputs.  Make use of this in the zlog code so logging
targets have access to this information.

(This also records how long the `[XXXXX-XXXXX][EC 9999999]` prefix was
so log targets can choose to skip over it.)

Signed-off-by: David Lamparter <equinox@diac24.net>
Signed-off-by: David Lamparter <equinox@diac24.net>
This is old-style syslog, used among other things for /dev/log.

Signed-off-by: David Lamparter <equinox@diac24.net>
Since the file targets append one anyway, save them some extra work.
syslog can use `%.*s` since it's "forced" printf by API anyway.

Signed-off-by: David Lamparter <equinox@diac24.net>
glibc removed its pid cache a while back, and grabbing this from TLS is
faster than repeatedly calling the kernel...

Also use `intmax_t` which is more appropriate for both PID & TID.

Signed-off-by: David Lamparter <equinox@diac24.net>
Signed-off-by: David Lamparter <equinox@diac24.net>
eqvinox added 2 commits April 21, 2021 16:26
Might've made a few things too many `static` there.

Signed-off-by: David Lamparter <equinox@diac24.net>
*sigh*.  It doesn't accept `%m` otherwise.

Signed-off-by: David Lamparter <equinox@diac24.net>
Copy link

@polychaeta polychaeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution to FRR!

Click for style suggestions

To apply these suggestions:

curl -s https://gist.githubusercontent.com/polychaeta/5b51414332bc23ce624dc0ab699a727b/raw/3d0b8ad34097d1a05813ef98253dcb20d7c6e30f/cr_8457_1619015291.diff | git apply

diff --git a/lib/log_vty.c b/lib/log_vty.c
index 1cf90697c..fb8ac1ef8 100644
--- a/lib/log_vty.c
+++ b/lib/log_vty.c
@@ -596,13 +596,8 @@ DEFUN (no_config_log_filterfile,
 	return CMD_SUCCESS;
 }
 
-DEFPY (log_filter,
-       log_filter_cmd,
-       "[no] log filter-text WORD$filter",
-       NO_STR
-       "Logging control\n"
-       FILTER_LOG_STR
-       "String to filter by\n")
+DEFPY(log_filter, log_filter_cmd, "[no] log filter-text WORD$filter",
+      NO_STR "Logging control\n" FILTER_LOG_STR "String to filter by\n")
 {
 	int ret = 0;
 
@@ -625,24 +620,16 @@ DEFPY (log_filter,
 }
 
 /* Clear all log filters */
-DEFPY (log_filter_clear,
-       log_filter_clear_cmd,
-       "clear log filter-text",
-       CLEAR_STR
-       "Logging control\n"
-       FILTER_LOG_STR)
+DEFPY(log_filter_clear, log_filter_clear_cmd, "clear log filter-text",
+      CLEAR_STR "Logging control\n" FILTER_LOG_STR)
 {
 	zlog_filter_clear();
 	return CMD_SUCCESS;
 }
 
 /* Show log filter */
-DEFPY (show_log_filter,
-       show_log_filter_cmd,
-       "show logging filter-text",
-       SHOW_STR
-       "Show current logging configuration\n"
-       FILTER_LOG_STR)
+DEFPY(show_log_filter, show_log_filter_cmd, "show logging filter-text",
+      SHOW_STR "Show current logging configuration\n" FILTER_LOG_STR)
 {
 	char log_filters[ZLOG_FILTERS_MAX * (ZLOG_FILTER_LENGTH_MAX + 3)] = "";
 	int len = 0;
diff --git a/lib/zlog_targets.c b/lib/zlog_targets.c
index 48785ad29..ba0a54e20 100644
--- a/lib/zlog_targets.c
+++ b/lib/zlog_targets.c
@@ -120,9 +120,9 @@ void zlog_fd(struct zlog_target *zt, struct zlog_msg *msgs[], size_t nmsgs)
 		 *  - this being the last message in the batch
 		 *  - not enough remaining iov entries
 		 */
-		if (iovpos > 0 && (ts_buf + sizeof(ts_buf) - ts_pos < TS_LEN
-				   || i + 1 == nmsgs
-				   || array_size(iov) - iovpos < 5)) {
+		if (iovpos > 0
+		    && (ts_buf + sizeof(ts_buf) - ts_pos < TS_LEN
+			|| i + 1 == nmsgs || array_size(iov) - iovpos < 5)) {
 			writev(fd, iov, iovpos);
 
 			iovpos = 0;

If you are a new contributor to FRR, please see our contributing guidelines.

After making changes, you do not need to create a new PR. You should perform an amend or interactive rebase followed by a force push.

@LabN-CI
Copy link
Collaborator

LabN-CI commented Apr 21, 2021

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/8457 9ae3238
Date 04/21/2021
Start 11:32:25
Finish 12:13:42
Run-Time 41:17
Total 1815
Pass 1815
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2021-04-21-11:32:25.txt
Log autoscript-2021-04-21-11:33:37.log.bz2
Memory 502 505 430

For details, please contact louberger

@qlyoung qlyoung self-requested a review April 21, 2021 17:23
@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18530/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Warnings Generated during build:

Checkout code: Successful with additional warnings
Report for command.c | 2 issues
===============================================
< WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
< #1245: FILE: /tmp/f1-27463/command.c:1245:
Report for log_filter.c | 2 issues
===============================================
< ERROR: do not use assignment in if condition
< #139: FILE: /tmp/f1-27463/log_filter.c:139:
Report for log_vty.c | 2 issues
===============================================
< ERROR: "foo * bar" should be "foo *bar"
< #37: FILE: /tmp/f1-27463/log_vty.c:37:
Report for log_vty.h | 2 issues
===============================================
< ERROR: "foo * bar" should be "foo *bar"
< #43: FILE: /tmp/f1-27463/log_vty.h:43:

CLANG Static Analyzer Summary

  • Github Pull Request 8457, comparing to Git base SHA bf6005d
  • Base image data for Git bf6005d does not exist - compare skipped

6 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18530/artifact/shared/static_analysis/index.html

@eqvinox
Copy link
Contributor Author

eqvinox commented Apr 22, 2021

@qlyoung if you're looking at this, #8527 are the first 2 commits broken off

@eqvinox
Copy link
Contributor Author

eqvinox commented May 10, 2021

reopening PR in an attempt to breathe life into this 😢

@eqvinox eqvinox closed this May 10, 2021
@eqvinox eqvinox deleted the xref-5424-prep branch May 10, 2021 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants