aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_probe.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp_probe.c')
-rw-r--r--net/ipv4/tcp_probe.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c
index 611beab38a00..8b97d71e193b 100644
--- a/net/ipv4/tcp_probe.c
+++ b/net/ipv4/tcp_probe.c
@@ -101,22 +101,6 @@ static inline int tcp_probe_avail(void)
101 si4.sin_addr.s_addr = inet->inet_##mem##addr; \ 101 si4.sin_addr.s_addr = inet->inet_##mem##addr; \
102 } while (0) \ 102 } while (0) \
103 103
104#if IS_ENABLED(CONFIG_IPV6)
105#define tcp_probe_copy_fl_to_si6(inet, si6, mem) \
106 do { \
107 struct ipv6_pinfo *pi6 = inet->pinet6; \
108 si6.sin6_family = AF_INET6; \
109 si6.sin6_port = inet->inet_##mem##port; \
110 si6.sin6_addr = pi6->mem##addr; \
111 si6.sin6_flowinfo = 0; /* No need here. */ \
112 si6.sin6_scope_id = 0; /* No need here. */ \
113 } while (0)
114#else
115#define tcp_probe_copy_fl_to_si6(fl, si6, mem) \
116 do { \
117 memset(&si6, 0, sizeof(si6)); \
118 } while (0)
119#endif
120 104
121/* 105/*
122 * Hook inserted to be called before each receive packet. 106 * Hook inserted to be called before each receive packet.
@@ -147,8 +131,17 @@ static void jtcp_rcv_established(struct sock *sk, struct sk_buff *skb,
147 tcp_probe_copy_fl_to_si4(inet, p->dst.v4, d); 131 tcp_probe_copy_fl_to_si4(inet, p->dst.v4, d);
148 break; 132 break;
149 case AF_INET6: 133 case AF_INET6:
150 tcp_probe_copy_fl_to_si6(inet, p->src.v6, s); 134 memset(&p->src.v6, 0, sizeof(p->src.v6));
151 tcp_probe_copy_fl_to_si6(inet, p->dst.v6, d); 135 memset(&p->dst.v6, 0, sizeof(p->dst.v6));
136#if IS_ENABLED(CONFIG_IPV6)
137 p->src.v6.sin6_family = AF_INET6;
138 p->src.v6.sin6_port = inet->inet_sport;
139 p->src.v6.sin6_addr = inet6_sk(sk)->saddr;
140
141 p->dst.v6.sin6_family = AF_INET6;
142 p->dst.v6.sin6_port = inet->inet_dport;
143 p->dst.v6.sin6_addr = sk->sk_v6_daddr;
144#endif
152 break; 145 break;
153 default: 146 default:
154 BUG(); 147 BUG();