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
garp: Introduce Gratuitous ARP Cell #25254
garp: Introduce Gratuitous ARP Cell #25254
Conversation
995c3a8
to
22d41d5
Compare
22d41d5
to
64ad887
Compare
👋 We used to have a well tested arping library which later got removed - 8a8ac6c. Maybe we could reuse it? |
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.
Vendor changes lgtm.
The library you point out creates ARP requests and parses replies, that is not what we need since we are sending ARP Replies out without getting a request. |
pkg/datapath/garp/garp.go
Outdated
|
||
// Send implements Sender | ||
func (s *sender) Send(ip netip.Addr) error { | ||
arpClient, err := arp.Dial(s.iface) |
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.
Do we need to create the client each time or can it be initialized once in newGARPSender
?
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.
The client that's created uses a raw socket underneath. I'm worried about keeping a raw socket open all the time, and figured it would be better to create and destroy on-demand. If there's no issue with keeping raw sockets open, then I'm happy to create the client in the constructor.
c75356a
to
b65238d
Compare
In addition to @dylandreimerink 's comments, I also believe the current approach is less code, relies on an existing dependency, and that the library used is also a well-tested one. |
Gratuitous ARP is the process of broadcasting unsolicited ARP packets, usually with the goal of informing all Layer 2 devices of a new IP/MAC association on the L2 domain and forcing any switches to relearn the MAC address. Here we add the `garp` cell. While not really useful yet, the purpose is to provide a simple Hive Cell that implements the new `garp.Sender` interface, so that any other Cell may send gratuitous ARP packets. Signed-off-by: Mark Pashmfouroush <mark@isovalent.com>
b65238d
to
4eed933
Compare
/test |
Gratuitous ARP is the process of broadcasting unsolicited ARP packets, usually with the goal of informing all Layer 2 devices of a new IP/MAC association on the L2 domain and forcing any switches to relearn the MAC address.
Here we add the
garp
cell. While not really useful yet, the purpose is to provide a simple Hive Cell that implements the newgarp.Sender
interface, so that any other Cell may send gratuitous ARP packets.Signed-off-by: Mark Pashmfouroush mark@isovalent.com