-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Bug 1505266 - Validate node IP is local during sdn node initialization #17043
Bug 1505266 - Validate node IP is local during sdn node initialization #17043
Conversation
@openshift/networking @danwinship PTAL |
pkg/network/node/node.go
Outdated
@@ -144,36 +144,17 @@ func New(c *OsdnNodeConfig) (network.NodeInterface, error) { | |||
return nil, nil | |||
} | |||
|
|||
if useConnTrack && c.ProxyMode != componentconfig.ProxyModeIPTables { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like it's better to always log the "Initializing SDN" message... can you move things around so that happens before this? (And why did you move this before setNodeIP
? Why does that matter?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, it is always good to log this msg.
This proxy check doesn't depend on computing hostname/selfIP, so I just moved that logic a bit up in this method.
pkg/network/common/common.go
Outdated
|
||
for _, addr := range addrs { | ||
if addr.IP.String() == ip { | ||
return link, addr.IPNet, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the same as what findEgressLink() was doing. The netlink.Addr
's embedded IPNet
is an IP address (eg "172.17.0.3/24"), but eip.localEgressNet
is supposed to be the subnet CIDR that includes it (eg "172.17.0.0/24"). Hence the re-parsing of it (because there's no public method to directly mask the IP address form into the subnet form).
Check proxy mode in node.New() before computing hostname/selfIP so that we can return early in case of incompatible proxy mode error.
607e90b
to
75adfb4
Compare
@danwinship Updated, PTAL |
/retest |
/refresh |
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: danwinship, pravisankar The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/retest Please review the full test history for this PR and help us cut down flakes. |
Automatic merge from submit-queue. |
Automatic merge from submit-queue. Fix cross build #17043 broke the cross build by depending on netlink from pkg/network/common. This fixes that (by just moving the new function since it wasn't needed outside of pkg/network/node anyway).
Fix for https://bugzilla.redhat.com/show_bug.cgi?id=1505266