Skip to content

Commit

Permalink
bgpd: fix warning of compilation when using bgp_trace
Browse files Browse the repository at this point in the history
The following warning can be seen:
> In file included from ./bgpd/bgp_trace.h:21,
>                  from bgpd/bgp_io.c:27:
> bgpd/bgp_io.c: In function ‘read_ibuf_work’:
> bgpd/bgp_io.c:202:53: warning: passing argument 1 of ‘lttng_ust_tracepoint_cb_frr_bgp___packet_read’ from incompatible pointer type [-Wincompatible-pointer-types]
>   202 |         frrtrace(2, frr_bgp, packet_read, connection->peer, pkt);
>       |                                           ~~~~~~~~~~^~~~~~
>       |                                                     |
>       |                                                     struct peer *
> bgpd/bgp_io.c:202:9: note: in expansion of macro ‘frrtrace’
>   202 |         frrtrace(2, frr_bgp, packet_read, connection->peer, pkt);
>       |         ^~~~~~~~
> In file included from ./bgpd/bgp_trace.h:21,
>                  from bgpd/bgp_io.c:27:
> ./bgpd/bgp_trace.h:57:43: note: expected ‘struct peer_connection *’ but argument is of type ‘struct peer *’
>    57 |         TP_ARGS(struct peer_connection *, connection, struct stream *, pkt),
>       |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

Use the appropriate connection parameter when calling the trace.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
  • Loading branch information
pguibert6WIND committed Nov 16, 2024
1 parent 405bba6 commit b8a6514
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bgpd/bgp_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ static int read_ibuf_work(struct peer_connection *connection)
assert(ringbuf_get(ibw, pkt->data, pktsize) == pktsize);
stream_set_endp(pkt, pktsize);

frrtrace(2, frr_bgp, packet_read, connection->peer, pkt);
frrtrace(2, frr_bgp, packet_read, connection, pkt);
frr_with_mutex (&connection->io_mtx) {
stream_fifo_push(connection->ibuf, pkt);
}
Expand Down

0 comments on commit b8a6514

Please sign in to comment.