From: Ziyang Xuan william.xuanziyang@huawei.com
hulk inclusion category: bugfix bugzilla: 187826, https://gitee.com/openeuler/kernel/issues/I9K8D1
--------------------------------
In bpf_getorigdst_impl(), argument 1 of type 'void *' is not compatible with argument 2 of type 'struct sockaddr_in *' in call to function 'memcpy'.
Cast type of argument 2 to 'void *' to fix the warning.
Fixes: 877e893ac68e ("[Huawei] bpf: Add new bpf helper to get SO_ORIGINAL_DST/REPLY_SRC") Signed-off-by: Ziyang Xuan william.xuanziyang@huawei.com Signed-off-by: Dong Chenchen dongchenchen2@huawei.com --- net/netfilter/nf_conntrack_proto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/nf_conntrack_proto.c b/net/netfilter/nf_conntrack_proto.c index 1922620c8405..ca4bfbc8afd8 100644 --- a/net/netfilter/nf_conntrack_proto.c +++ b/net/netfilter/nf_conntrack_proto.c @@ -344,7 +344,7 @@ bpf_getorigdst_impl(struct sock *sk, int optval, void *user, int *len, int dir) &sin.sin_addr.s_addr, ntohs(sin.sin_port)); nf_ct_put(ct);
- memcpy(user, &sin, sizeof(sin)); + memcpy(user, (void *)&sin, sizeof(sin)); return 0; } pr_debug("SO_ORIGINAL_DST: Can't find %pI4/%hu-%pI4/%hu.\n",