Skip to content

Commit

Permalink
make gen
Browse files Browse the repository at this point in the history
Signed-off-by: LiZhenCheng9527 <[email protected]>
  • Loading branch information
LiZhenCheng9527 committed Jul 29, 2024
1 parent 91d82fb commit dcc3c1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bpf/kmesh/probes/metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ static inline void construct_metric_key(struct bpf_sock *sk, __u8 direction, str
bpf_memcpy(key->dst_ip.ip6, sk->dst_ip6, IPV6_ADDR_LEN);
}
key->dst_port = bpf_ntohs(sk->dst_port);
}
}
if (direction == INBOUND) {
if (sk->family == AF_INET) {
key->src_ip.ip4 = sk->dst_ip4;
key->dst_ip.ip4 = sk->src_ip4;
}
if (sk->family == AF_INET6 ) {
if (sk->family == AF_INET6) {
bpf_memcpy(key->src_ip.ip6, sk->dst_ip6, IPV6_ADDR_LEN);
bpf_memcpy(key->dst_ip.ip6, sk->src_ip6, IPV6_ADDR_LEN);
}
Expand Down
2 changes: 1 addition & 1 deletion bpf/kmesh/workload/sockops.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static inline bool is_managed_by_kmesh(struct bpf_sock_ops *skops)
struct manager_key key = {0};
if (skops->family == AF_INET)
key.addr.ip4 = skops->local_ip4;
if (skops->family == AF_INET6){
if (skops->family == AF_INET6) {
if (is_ipv4_mapped_addr(skops->local_ip6))
key.addr.ip4 = skops->local_ip4;
else
Expand Down

0 comments on commit dcc3c1d

Please sign in to comment.