Skip to content

Commit 68b0375

Browse files
committed
fix lint and clarify comments
1 parent b3f39fe commit 68b0375

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

tailnet/test/integration/integration.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,13 +474,15 @@ func (UDPEchoService) StartService(t *testing.T, logger slog.Logger, _ *tailnet.
474474
logger.Info(context.Background(), "error reading UDPEcho listener", slog.Error(readErr))
475475
return
476476
}
477-
logger.Info(context.Background(), "received UDP packet",
477+
logger.Info(context.Background(), "received UDPEcho packet",
478478
slog.F("len", n), slog.F("remote", remote))
479479
n, writeErr := l.WriteToUDP(buf[:n], remote)
480480
if writeErr != nil {
481481
logger.Info(context.Background(), "error writing UDPEcho listener", slog.Error(writeErr))
482482
return
483483
}
484+
logger.Info(context.Background(), "wrote UDPEcho packet",
485+
slog.F("len", n), slog.F("remote", remote))
484486
}
485487
}()
486488
}

tailnet/test/integration/network.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,8 @@ func (n TriangleNetwork) SetupNetworking(t *testing.T, l slog.Logger) TestNetwor
512512
for _, iface := range interfaces {
513513
err = setInterfaceUp(iface.netNS, iface.ifaceName)
514514
require.NoErrorf(t, err, "bring up interface %q", iface.ifaceName)
515-
// Note: routes are not needed as the interfaces are defined as /24, and we are fully connected, so nothing
516-
// needs to forward IP to a further destination.
515+
// Note: routes are not needed as we are fully connected, so nothing needs to forward IP to a further
516+
// destination.
517517
}
518518

519519
return TestNetworking{
@@ -616,8 +616,8 @@ func createNetNS(t *testing.T, name string) *os.File {
616616
})
617617

618618
// Open /run/netns/$name to get a file descriptor to the network namespace.
619-
path := fmt.Sprintf("/run/netns/%s", name)
620-
file, err := os.OpenFile(path, os.O_RDONLY, 0)
619+
netnsPath := fmt.Sprintf("/run/netns/%s", name)
620+
file, err := os.OpenFile(netnsPath, os.O_RDONLY, 0)
621621
require.NoError(t, err, "open network namespace file")
622622
t.Cleanup(func() {
623623
_ = file.Close()
@@ -717,8 +717,8 @@ func setInterfaceIP(netNS *os.File, ifaceName, ip string) error {
717717
return nil
718718
}
719719

720-
// setInterfaceIP sets the IP address on the given interface. It automatically
721-
// adds a /24 subnet mask.
720+
// setInterfaceIP6 sets the IPv6 address on the given interface. It automatically
721+
// adds a /64 subnet mask.
722722
func setInterfaceIP6(netNS *os.File, ifaceName, ip string) error {
723723
_, err := commandInNetNS(netNS, "ip", []string{"addr", "add", ip + "/64", "dev", ifaceName}).Output()
724724
if err != nil {

0 commit comments

Comments
 (0)