Fix v6_routethrough misplaced technique switch #636
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What:
procroutetechnique is the default technique for getting the interface we want to use for some given destination addr. This technique is represented as a static enum. Previously the technique was set to fallback method connectsockettechnique even though an appropriate interface was found because the fallback method was activated after the first route in /proc/net/ipv6_route was checked and not after all routes were checked. Every additional invocation of the function therefore used the fallback method as new default.
Why:
Fix issue, improve performance.
How:
Add the following code at the beginning of openvas.c/openvas() and add some prints in misc/pcap.c/v6_routethrough() for printing out what method we are using.
Result should be something like the following with the PR:
And something like the following without the PR:
Checklist: