selftests/bpf: Use send_to_addr_str in tc_netkit
This patch uses network helper send_to_addr_str() in __send_icmp() in
tc_netkit test. Since it accepts a string type address "addr_str", change
the parameter of __send_icmp() as "const char *" too. Also set addresses
"ping_addr_neigh" and "ping_addr_noneigh" as strings.
IPPROTO_ICMP is used, set it as opts.proto. And BINDTODEVICE sockopt needs
to be set, do this in a "bind_to_device_cb" callback.
Use ASSERT_OK_FD() to check the return fd of send_to_addr_str().
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
1 file changed