Skip to content

Commit 8900567

Browse files
dsaherndavem330
authored andcommitted
tcp: Remove use of inet6_sk and add IPv6 checks to tracepoint
386fd5d ("tcp: Check daddr_cache before use in tracepoint") was the second version of the tracepoint fixup patch. This patch is the delta between v2 and v3. Specifically, remove the use of inet6_sk and check sk_family as requested by Eric and add IS_ENABLED(CONFIG_IPV6) around the use of sk_v6_rcv_saddr and sk_v6_daddr as done in sock_common (noted by Cong). Signed-off-by: David Ahern <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Tested-by: Song Liu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 17c9188 commit 8900567

File tree

1 file changed

+5
-3
lines changed
  • include/trace/events

1 file changed

+5
-3
lines changed

include/trace/events/tcp.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,15 @@ TRACE_EVENT(tcp_retransmit_skb,
4343
p32 = (__be32 *) __entry->daddr;
4444
*p32 = inet->inet_daddr;
4545

46-
/* IPv6 socket ? */
47-
if (inet6_sk(sk)) {
46+
#if IS_ENABLED(CONFIG_IPV6)
47+
if (sk->sk_family == AF_INET6) {
4848
pin6 = (struct in6_addr *)__entry->saddr_v6;
4949
*pin6 = sk->sk_v6_rcv_saddr;
5050
pin6 = (struct in6_addr *)__entry->daddr_v6;
5151
*pin6 = sk->sk_v6_daddr;
52-
} else {
52+
} else
53+
#endif
54+
{
5355
pin6 = (struct in6_addr *)__entry->saddr_v6;
5456
ipv6_addr_set_v4mapped(inet->inet_saddr, pin6);
5557
pin6 = (struct in6_addr *)__entry->daddr_v6;

0 commit comments

Comments
 (0)