@@ -512,8 +512,8 @@ func (n TriangleNetwork) SetupNetworking(t *testing.T, l slog.Logger) TestNetwor
512
512
for _ , iface := range interfaces {
513
513
err = setInterfaceUp (iface .netNS , iface .ifaceName )
514
514
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.
517
517
}
518
518
519
519
return TestNetworking {
@@ -616,8 +616,8 @@ func createNetNS(t *testing.T, name string) *os.File {
616
616
})
617
617
618
618
// 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 )
621
621
require .NoError (t , err , "open network namespace file" )
622
622
t .Cleanup (func () {
623
623
_ = file .Close ()
@@ -717,8 +717,8 @@ func setInterfaceIP(netNS *os.File, ifaceName, ip string) error {
717
717
return nil
718
718
}
719
719
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.
722
722
func setInterfaceIP6 (netNS * os.File , ifaceName , ip string ) error {
723
723
_ , err := commandInNetNS (netNS , "ip" , []string {"addr" , "add" , ip + "/64" , "dev" , ifaceName }).Output ()
724
724
if err != nil {
0 commit comments