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

gateway: determine default local IP #3936

Merged
merged 3 commits into from
Nov 27, 2020

Conversation

matzf
Copy link
Contributor

@matzf matzf commented Nov 24, 2020

Determine default local IP for SIG as documented in config sample,
analogous to old SIG implementation.
Instead of copying the findDefaultLocalIP logic again, move to
addrutil.DefaultLocalIP library function.

Additionally includes losely related small cleanup in sciond.TopologyQuerier. (was included in 3938).

Closes #3933.


This change is Reviewable

@matzf matzf force-pushed the sig-default-local-ip branch 2 times, most recently from c52c3d7 to 9ae8256 Compare November 25, 2020 10:34
@scrye scrye self-requested a review November 25, 2020 12:13
@scrye scrye added the c/gateway SCION IP Gateway label Nov 25, 2020
Copy link
Contributor

@oncilla oncilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 6 of 6 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @matzf and @scrye)


go/lib/snet/addrutil/addrutil.go, line 103 at r1 (raw file):

// This returns a sensible but arbitrary local IP. In the general case the
// local IP would depend on the next hop of selected path. This approach will
// not work in more complicated setups where e.g. different network interface

s/interface/interfaces

Copy link
Contributor Author

@matzf matzf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 5 of 6 files reviewed, 1 unresolved discussion (waiting on @oncilla and @scrye)


go/lib/snet/addrutil/addrutil.go, line 103 at r1 (raw file):

Previously, Oncilla (Dominik Roos) wrote…

s/interface/interfaces

Well spotted 👀 Done.

Determine default local IP for SIG as documented in config sample,
analogous to old SIG implementation.
Instead of copying the findDefaultLocalIP logic again, move to
addrutil.DefaultLocalIP library function.
@matzf matzf force-pushed the sig-default-local-ip branch from 15eabf3 to be142c9 Compare November 26, 2020 07:49
Copy link
Contributor

@oncilla oncilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @scrye)

Copy link
Contributor

@scrye scrye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @matzf)

a discussion (no related file):
I was thinking about adding a request for documenting the behavior in the Gateway manual, but I think I'll take care of that afterwards (the behaviors for some configuration options are quite complex, and need a lot of documentation).

Found a few nits here and there, but otherwise we can merge this.



go/lib/snet/addrutil/addrutil.go, line 99 at r2 (raw file):

}

// DefaultLocalIP returns _a_ IP of this host in the local AS.

Nit: "a" -> "an"


go/lib/snet/addrutil/addrutil.go, line 107 at r2 (raw file):

//
// This is a simple workaround for not being able to use wildcard addresses
// with snet. Once a available, a wildcard address should be used instead and

Remove "a" before "available".


go/lib/snet/addrutil/addrutil.go, line 108 at r2 (raw file):

// This is a simple workaround for not being able to use wildcard addresses
// with snet. Once a available, a wildcard address should be used instead and
// this should simply be removed.

Remove "simply".

Copy link
Contributor Author

@matzf matzf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 5 of 6 files reviewed, 3 unresolved discussions (waiting on @oncilla and @scrye)


go/lib/snet/addrutil/addrutil.go, line 107 at r2 (raw file):

Previously, scrye (Sergiu Costea) wrote…

Remove "a" before "available".

Done.


go/lib/snet/addrutil/addrutil.go, line 108 at r2 (raw file):

Previously, scrye (Sergiu Costea) wrote…

Remove "simply".

Done.

Copy link
Contributor

@oncilla oncilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r3.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @scrye)

Copy link
Contributor

@scrye scrye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@scrye scrye merged commit 8044690 into scionproto:master Nov 27, 2020
@matzf matzf deleted the sig-default-local-ip branch November 27, 2020 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/gateway SCION IP Gateway
Projects
None yet
Development

Successfully merging this pull request may close these issues.

posix-gateway: reintroduce address inference
3 participants