Fix autoadd problem in post/windows/manage/autoroute #6780
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.
Error Description
In PR #6515, I submitted the "autoadd" feature. A function called is_routable? was added that was different from the original code that was submitted. This function contains errors that are causing invalid routes to be added.
Running a test using the current code, this is the output:
These routes are incorrect and do not work.
Fix
The routing check
elsif route.subnet =~ /[\d\.]+\.0$/
is causing part of the error and was removed for the fix.Also, this line:
elsif route.subnet == '255.255.255.255'
should be:elseif route.netmask == '255.255.255.255'
Once these changes are made the output is:
Which are correct routes.