-
Notifications
You must be signed in to change notification settings - Fork 1k
Filter out no IP interfaces for L2 advertisement #1347
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
Conversation
| } | ||
| if ipaddr.IP.To4() != nil || !ipaddr.IP.IsLinkLocalUnicast() { | ||
| continue | ||
| if ipaddr.IP.To4() != nil && (ifi.Flags&net.FlagBroadcast) != 0 { |
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.
Would it just check len (addrs) be enough to skip the interface?
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.
Never mind, checked offline. This is better as it takes into account the case where an interface is v4 or v6 only.
|
Code aside, we need to understand if this is always the behaviour we want, or if we are cutting out corner case that are still working. |
| if ipaddr.IP.To4() != nil || !ipaddr.IP.IsLinkLocalUnicast() { | ||
| continue | ||
| if ipaddr.IP.To4() != nil && (ifi.Flags&net.FlagBroadcast) != 0 { | ||
| keepARP[ifi.Index] = true |
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.
you can continue here, and no need for the else below, just the if
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.
yes @fedepaol , done.
In case of Layer 2 mode, it doesn't make sense to advertise service load balancer ip on the interfaces which don't have ip configured. This commit filers out those interfaces so that it won't be chosen for sending or responding arp/ndp messages. Signed-off-by: Periyasamy Palanisamy <pepalani@redhat.com>
539bcee to
4f05c23
Compare
|
LGTM |
A regression introduced by metallb#1347, we were adding records to the keepNDP map regardless of the fact that a v6 address was present on the interface. Here we enforce the if checking that the ip is not v4. Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
A regression introduced by #1347, we were adding records to the keepNDP map regardless of the fact that a v6 address was present on the interface. Here we enforce the if checking that the ip is not v4. Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
A regression introduced by metallb#1347, we were adding records to the keepNDP map regardless of the fact that a v6 address was present on the interface. Here we enforce the if checking that the ip is not v4. Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
A regression introduced by #1347, we were adding records to the keepNDP map regardless of the fact that a v6 address was present on the interface. Here we enforce the if checking that the ip is not v4. Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
A regression introduced by metallb/metallb#1347, we were adding records to the keepNDP map regardless of the fact that a v6 address was present on the interface. Here we enforce the if checking that the ip is not v4. Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
In case of Layer 2 mode, it doesn't make sense to advertise service
load balancer ip on the interfaces which don't have ip configured.
This commit filers out those interfaces so that it won't be chosen
for sending or responding arp/ndp messages.
Signed-off-by: Periyasamy Palanisamy pepalani@redhat.com