@@ -10,6 +10,7 @@ struct mptcp_sock {
struct inet_connection_sock sk;
__u32 token;
+ struct sock *first;
char ca_name[TCP_CA_NAME_MAX];
} __attribute__((preserve_access_index));
@@ -12,7 +12,9 @@
struct mptcp_storage {
__u32 invoked;
__u32 is_mptcp;
+ struct sock *sk;
__u32 token;
+ struct sock *first;
char ca_name[TCP_CA_NAME_MAX];
};
@@ -133,6 +135,12 @@ static int verify_msk(int map_fd, int client_fd)
err++;
}
+ if (val.first != val.sk) {
+ log_err("Unexpected mptcp_sock.first %p != %p",
+ val.first, val.sk);
+ err++;
+ }
+
if (strncmp(val.ca_name, ca_name, TCP_CA_NAME_MAX)) {
log_err("Unexpected mptcp_sock.ca_name %s != %s",
val.ca_name, ca_name);
@@ -12,7 +12,9 @@ __u32 _version SEC("version") = 1;
struct mptcp_storage {
__u32 invoked;
__u32 is_mptcp;
+ struct sock *sk;
__u32 token;
+ struct sock *first;
char ca_name[TCP_CA_NAME_MAX];
};
@@ -51,6 +53,7 @@ int _sockops(struct bpf_sock_ops *ctx)
storage->token = 0;
bzero(storage->ca_name, TCP_CA_NAME_MAX);
+ storage->first = NULL;
} else {
msk = bpf_skc_to_mptcp_sock(sk);
if (!msk)
@@ -63,9 +66,11 @@ int _sockops(struct bpf_sock_ops *ctx)
storage->token = msk->token;
memcpy(storage->ca_name, msk->ca_name, TCP_CA_NAME_MAX);
+ storage->first = msk->first;
}
storage->invoked++;
storage->is_mptcp = tcp_sk->is_mptcp;
+ storage->sk = (struct sock *)sk;
return 1;
}