1- #!/usr/bin/python3
1+ #!/usr/bin/python3
22
33# This is intended to be used via sudo. For example, add via visudo:
44# %developers ALL = NOPASSWD: /usr/local/sbin/labgrid-bound-connect
@@ -15,7 +15,7 @@ def main(ifname, address, port):
1515 raise ValueError ("Empty interface name." )
1616 if any ((c == "/" or c .isspace ()) for c in ifname ):
1717 raise ValueError (f"Interface name '{ ifname } ' contains invalid characters." )
18- if len (ifname ) > 16 :
18+ if len (ifname ) > 15 :
1919 raise ValueError (f"Interface name '{ ifname } ' is too long." )
2020
2121 address = ipaddress .ip_address (address )
@@ -36,7 +36,7 @@ def main(ifname, address, port):
3636 raise RuntimeError (f"Invalid IP version '{ address .version } '" )
3737
3838 # Delete the IP lookup cache for the address in case it is stale
39- subprocess .run (["ip" , "neigh" , "del" , str (address ), "dev" , ifname ],
39+ subprocess .run (["ip" , "neigh" , "del" , str (address ), "dev" , ifname ],
4040 stdout = subprocess .DEVNULL ,
4141 stderr = subprocess .DEVNULL
4242 )
@@ -78,4 +78,3 @@ if __name__ == "__main__":
7878 import traceback
7979 traceback .print_exc ()
8080 print (f"ERROR: { e } " , file = sys .stderr )
81-
0 commit comments