Open sasanj opened 5 years ago
@sasanj As seen in previous comment I tried to apply your patch on top of the ipv6 feature in my fork. My tests are fine so far, but I lack a proper IPv6 address and name resolution in my virtual machine to test all combinations of force 4 or 6 or not force in combination with the interface flag. Would be great if you could have a look. :smirk:
@TDFKAOlli sorry for being late. This patch definitely won't work with IPv6. However, adding IPv6 support is simple. But I don't think it can be added to this repo. This knock
is strictly IPv4.
@sasanj O.k. I think you didn't get what I meant. Sorry, let me try again: I have taken your patch and applied it to my repository including IPv6. Then I extended it to support IPv6. I have tested it in my virtual machine having an routable IPv4 address but only having a link local IPv6. So I wondered if you have time to review https://github.com/TDFKAOlli/knock/commit/dc9f84efbf18469740e26bb9d2e1e7372fc3c107
Hi, Recently I needed to knock a server from a client with multiple network interfaces which had different gateways, and since
knock
did not have a way to choose an interface, I added one. Hopefully, It is useful to others.I implemented two ways to find the ip address of an interface. One, using
ioctl
which is the wayknockd
also uses, and the other one uses glibcgetifaddrs
. The idea is to refactor the code for finding the interface's address; in bothknock
andknockd
. There is an option inconfigure
(namely--disable-getifaddrs
) to choose between each way.Manual pages have also been changed, accordingly.