-
Notifications
You must be signed in to change notification settings - Fork 459
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
broadcast free arp when pod is setup #2638
Conversation
|
|
pkg/util/arp.go
Outdated
@@ -199,17 +199,45 @@ func ArpDetectIPConflict(nic, ip string, mac net.HardwareAddr) (net.HardwareAddr | |||
// Announcement is identical to the ARP Probe described above, | |||
// except that now the sender and target IP addresses are both | |||
// set to the host's newly selected IPv4 address. | |||
if pkt, err = arp.NewPacket(arp.OperationRequest, mac, tpa, tha, tpa); err != nil { | |||
err = BroadcastFreeArp(nic, ip, mac, announceNum, announceInterval) |
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.
if err = ...; err != 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.
fixed
pkg/util/arp.go
Outdated
|
||
func BroadcastFreeArp(nic, ip string, mac net.HardwareAddr, announceNum int, announceInterval time.Duration) error { | ||
klog.Infof("broadcast free arp with nic %s , ip %s, with mac %v ", nic, ip, mac) | ||
ifi, err := net.InterfaceByName(nic) |
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.
ifi should be replaced by more meaningful name
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.
replaced
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.
fixed
add defer
|
|
What type of this PR
Examples of user facing changes:
Which issue(s) this PR fixes:
Fixes #(issue-number)
WHAT
🤖 Generated by Copilot at 4e8d30a
This pull request adds a new feature to enable or disable IP conflict detection in the kube-ovn controller, and improves the ARP handling for pod IP addresses. It introduces a new flag
detectIPConflict
and a new utility functionBroadcastFreeArp
in theutil
package, and modifies theconfigureNic
andannounce
functions in theovs_linux.go
andipam.go
files respectively.🤖 Generated by Copilot at 4e8d30a
HOW
🤖 Generated by Copilot at 4e8d30a