Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting preferred source in routes per interface and ip address #31

Closed
wants to merge 2 commits into from
Closed

Allow setting preferred source in routes per interface and ip address #31

wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Mar 29, 2019

This replaces #18 and adds the ability to filter by address while keeping the feature of filtering by interface

@jech
Copy link
Owner

jech commented Apr 11, 2019

I'm not sure I understand what's going on in rule.c.

The current code allows setting the destination table in an install filter; it appears that you remove this functionality. Is that correct?

If that's the case, then this needs to be discussed on the mailing list, and you'll need to split the patch into two (one that removes the existing functionality, and one that adds the new functionality).

@ghost
Copy link
Author

ghost commented Apr 12, 2019

This PR does not remove existing functionality. We move some code from rule.c to disambiguation.c to avoid calling install_filter twice.
In other words, the beginning of find_table is moved to the only place this function is used.

@ghost
Copy link
Author

ghost commented Apr 24, 2019

@jech I split the PR in two commits, separating the refactoring part and the new feature to set pref-src through install filters

@ghost
Copy link
Author

ghost commented May 8, 2019

@jech what do you think? I'll start working on the documentation if everything is okay for you !

Killian Lufau added 2 commits June 24, 2019 15:06
This is only a cleanup and not a functional change
The purpose is to override *locally* RTA_PREFSRC ('src' in ip-route).
@ghost
Copy link
Author

ghost commented Jun 24, 2019

@jech,

Thanks for your comment on #18,
In reply to this,

  • I fixed the compilation and applied the changes you wanted.

  • In regards to "on this subject — should the check for m < INFINITY be here or in kernel_route? I don't mind either way, but I'm wondering.",
    I think it's okay to let it here, plus if we put it in kernel_route we should carry the value of the return of install_filter and filter_result.pref_src as well.

@jech
Copy link
Owner

jech commented Jun 25, 2019

Looks good to me. Applied but not pushed yet.

@jech
Copy link
Owner

jech commented Jun 25, 2019

Note that this has pretty horrible error behaviour — if the pref-src address doesn't correspond to a locally assigned IP address, then route installation fails with EINVAL. Babeld will recover, but it will try again slightly later.

Pushed, thanks Killian.

@jech jech closed this Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant