net: port TP_STORE_ADDR_PORTS_SKB macro to be tcp/udp independent
authorBalazs Scheidler <bazsi77@gmail.com>
Tue, 26 Mar 2024 18:05:46 +0000 (19:05 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 29 Mar 2024 19:18:24 +0000 (12:18 -0700)
commita0ad11fc2632903ec0fe9cd16b07d7dd2ade8341
treecbbafc5ca69f82aafd763cd4d10bddd622b61981
parentb7b1c59069123368a939327d49009e8771e88d9c
net: port TP_STORE_ADDR_PORTS_SKB macro to be tcp/udp independent

This patch moves TP_STORE_ADDR_PORTS_SKB() to a common header and removes
the TCP specific implementation details.

Previously the macro assumed the skb passed as an argument is a
TCP packet, the implementation now uses an argument to the L4 header and
uses that to extract the source/destination ports, which happen
to be named the same in "struct tcphdr" and "struct udphdr"

Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Link: https://lore.kernel.org/r/9e306f78260dfbbdc7353ba5f864cc027a409540.1711475011.git.balazs.scheidler@axoflow.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/trace/events/net_probe_common.h
include/trace/events/tcp.h