diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2021-09-28 11:20:32 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2021-09-28 11:20:32 +0200 |
commit | f62de63c6a0cf38ea20ecdb35194424be06c01fe (patch) | |
tree | 9c529653d39a100e6a20a12dc8758e6439c908d6 /bfdd | |
parent | Merge pull request #9675 from opensourcerouting/pim-bsm-uaf (diff) | |
download | frr-f62de63c6a0cf38ea20ecdb35194424be06c01fe.tar.xz frr-f62de63c6a0cf38ea20ecdb35194424be06c01fe.zip |
*: `frr-format` with unmodified GCC
Since there's very few locations where the `frr-format` actually prints
false positive warnings, consensus seems to be to just work around the
false positives even if the code is correct.
In fact, there is only one pattern of false positives currently, in
`bfdd/dplane.c` which does `vty_out("%"PRIu64, (uint64_t)be64toh(...))`.
The workaround/fix for this is a replacement `be64toh` whose type is
always `uint64_t` regardless of what OS we're on, making the cast
unnecessary.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'bfdd')
-rw-r--r-- | bfdd/dplane.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/bfdd/dplane.c b/bfdd/dplane.c index 4b7f9ba7a..9dee2a558 100644 --- a/bfdd/dplane.c +++ b/bfdd/dplane.c @@ -157,8 +157,8 @@ static void bfd_dplane_debug_message(const struct bfddp_message *msg) case ECHO_REPLY: case ECHO_REQUEST: zlog_debug(" [dp_time=%" PRIu64 " bfdd_time=%" PRIu64 "]", - (uint64_t)be64toh(msg->data.echo.dp_time), - (uint64_t)be64toh(msg->data.echo.bfdd_time)); + be64toh(msg->data.echo.dp_time), + be64toh(msg->data.echo.bfdd_time)); break; case DP_ADD_SESSION: @@ -245,21 +245,18 @@ static void bfd_dplane_debug_message(const struct bfddp_message *msg) " packets), " "out %" PRIu64 " bytes (%" PRIu64 " packets)}]", ntohl(msg->data.session_counters.lid), - (uint64_t)be64toh( - msg->data.session_counters.control_input_bytes), - (uint64_t)be64toh(msg->data.session_counters - .control_input_packets), - (uint64_t)be64toh(msg->data.session_counters - .control_output_bytes), - (uint64_t)be64toh(msg->data.session_counters - .control_output_packets), - (uint64_t)be64toh(msg->data.session_counters.echo_input_bytes), - (uint64_t)be64toh( - msg->data.session_counters.echo_input_packets), - (uint64_t)be64toh( - msg->data.session_counters.echo_output_bytes), - (uint64_t)be64toh(msg->data.session_counters - .echo_output_packets)); + be64toh(msg->data.session_counters.control_input_bytes), + be64toh(msg->data.session_counters + .control_input_packets), + be64toh(msg->data.session_counters + .control_output_bytes), + be64toh(msg->data.session_counters + .control_output_packets), + be64toh(msg->data.session_counters.echo_input_bytes), + be64toh(msg->data.session_counters.echo_input_packets), + be64toh(msg->data.session_counters.echo_output_bytes), + be64toh(msg->data.session_counters + .echo_output_packets)); break; } } |