From 57770ee37af92644977e8f472976a6cd90b393b6 Mon Sep 17 00:00:00 2001 From: Pavlo Golub Date: Tue, 14 Jan 2025 17:37:58 +0100 Subject: [PATCH] add htons() comment, fix createGratuitousARP() comment --- ipmanager/basicConfigurer.go | 2 +- ipmanager/basicConfigurer_linux.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ipmanager/basicConfigurer.go b/ipmanager/basicConfigurer.go index 54891ce..d5f1a25 100644 --- a/ipmanager/basicConfigurer.go +++ b/ipmanager/basicConfigurer.go @@ -53,7 +53,7 @@ const ( IPv4AddressSize = 4 ) -// arpSendGratuitous is a function that sends gratuitous ARP requests +// createGratuitousARP prepares a packet with a gratuitous ARP request func (c *BasicConfigurer) createGratuitousARP() ([]byte, error) { // Create the Ethernet layer ethLayer := &layers.Ethernet{ diff --git a/ipmanager/basicConfigurer_linux.go b/ipmanager/basicConfigurer_linux.go index 8a738c7..a18d95c 100644 --- a/ipmanager/basicConfigurer_linux.go +++ b/ipmanager/basicConfigurer_linux.go @@ -6,6 +6,7 @@ import ( "syscall" ) +// htons converts uint16 to network byte order func htons(i uint16) uint16 { return (i<<8)&0xff00 | i>>8 }