Closed dankamongmen closed 2 years ago
the failure actually manifests as
/home/dank/src/dankamongmen/libnetstack/tests/notrack.cpp:77: Failure
Expected: ("") != (cc.name), actual: "" vs ""
but this is due, i'm pretty sure, to the lack of RTM_NEWLINK
messages.
i bet we're not sending the request correctly in netstack_tx_thread()
...let's strace
indeed, it looks like we're leaving that out of the sendmsg()
...
oh yep:
if(ns->opts.iface_cb || !ns->opts.iface_notrack){
if(nl_socket_add_memberships(ns->nl, RTNLGRP_LINK, NFNLGRP_NONE)){
return -1;
}
hrmm, but even with iface_notrack
commented out, the problem persists? and why doesn't it happen when i run the test by itself?
here's what we send when run by ourselves (without iface_notrack
):
[pid 104795] sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[{nlmsg_len=20, nlmsg_type=RTM_GETLINK, nlmsg_flags=NLM_F_REQUEST|NLM_F_ACK|NLM_F_DUMP, nlmsg_seq=1649603781, nlmsg_pid=1195481433}, {ifi_family=AF_UNSPEC, ...}], iov_len=20}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 20
[pid 104795] sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[{nlmsg_len=20, nlmsg_type=RTM_GETADDR, nlmsg_flags=NLM_F_REQUEST|NLM_F_ACK|NLM_F_DUMP, nlmsg_seq=1649603782, nlmsg_pid=1195481433}, {ifa_family=AF_UNSPEC, ...}], iov_len=20}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 20
[pid 104795] sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[{nlmsg_len=20, nlmsg_type=RTM_GETNEIGH, nlmsg_flags=NLM_F_REQUEST|NLM_F_ACK|NLM_F_DUMP, nlmsg_seq=1649603783, nlmsg_pid=1195481433}, {ndm_family=AF_UNSPEC, ...}], iov_len=20}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 20
[pid 104795] sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[{nlmsg_len=20, nlmsg_type=RTM_GETROUTE, nlmsg_flags=NLM_F_REQUEST|NLM_F_ACK|NLM_F_DUMP, nlmsg_seq=1649603784, nlmsg_pid=1195481433}, {rtm_family=AF_UNSPEC, ...}], iov_len=20}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 20
and we appear to send the same with iface_notrack
. i'm wondering if maybe this is something in libnl?
yeah because we only send the ROUTE request, and that initial test uses *_notrack
for everything but ROUTE. is libnl preserving state on us?
nope, we're peresisting state through static dumpmsgs
. pulling the static
fixes things. yay!
We get an error when running the
NoTrack
suite (interestingly, when we run onlyNoTrack.IfaceFailsLookup
, it passes).IfaceFailsLookup
fails afterNoTrack.NoWorkIsInvalid
succeeds. I've chased it down to noRTM_NEWLINK
messages arriving.