You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have thought a bunch about how to test netlink dependant things.
I looked at trying to put capture/replay code into libnl, but I gotta say that I found libnl not that helpful, and I had other things to do.
radvd doesn't use libnl, and the netlink.c code is pretty sweet.
It's not just netlink.c but also recv.c and send.c (really_send()) that need to have a seam inserted.
The easiest in my opinion is to move the actual socket creation/manipulation/sendto/recvfrom() code into new .c files, so that a radvd-testing executable can be created that has mock functions. (A "link seam"). I have code that replaces send/recv with calls to pcap(3) functions. netlink sockets can now be captured, I think, with tcpdump, so we'd have a pcap file of RS,NS, etc.. and a pcap file of netlink messages. (Better would be a single pcap-ng file that had both, mixed in the order we need). And a pcap{,-ng} file for output that would capture RAs, NA/ND, etc. [I don't recall if we ever send NAs]
The text was updated successfully, but these errors were encountered:
to move the actual socket creation/manipulation/sendto/recvfrom() code into new .c files, so that a radvd-testing executable can be created that has mock functions. (A "link seam").
I have thought a bunch about how to test netlink dependant things.
I looked at trying to put capture/replay code into libnl, but I gotta say that I found libnl not that helpful, and I had other things to do.
radvd doesn't use libnl, and the netlink.c code is pretty sweet.
It's not just netlink.c but also recv.c and send.c (really_send()) that need to have a seam inserted.
The easiest in my opinion is to move the actual socket creation/manipulation/sendto/recvfrom() code into new .c files, so that a radvd-testing executable can be created that has mock functions. (A "link seam"). I have code that replaces send/recv with calls to pcap(3) functions. netlink sockets can now be captured, I think, with tcpdump, so we'd have a pcap file of RS,NS, etc.. and a pcap file of netlink messages. (Better would be a single pcap-ng file that had both, mixed in the order we need). And a pcap{,-ng} file for output that would capture RAs, NA/ND, etc. [I don't recall if we ever send NAs]
The text was updated successfully, but these errors were encountered: