From f33b3cfec4f75e62d95b33cdde98b26bc51e1ddd Mon Sep 17 00:00:00 2001 From: yo Date: Thu, 21 Nov 2024 20:36:19 +0100 Subject: [PATCH] v0.42h: finish previous commit --- cmd/start.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/start.go b/cmd/start.go index 15d7f68..f8c5fc5 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -1009,11 +1009,15 @@ func setupVnetInterfaceJailSide(jail *Jail, hostepairs []string) error { } // Fix mac flapping and instabilities with bridged vnet network if gBridgeStaticMac { - log.Debugf("Set %s as static to %s in %s address cache\n") - cmd = fmt.Sprintf("/sbin/ifconfig %s static %s %s", bridge, nic, jsmac) + printablemac := hex.EncodeToString(jsmac) + for i := 2 ; i < len(printablemac) ; i += 3 { + printablemac = printablemac[:i] + ":" + printablemac[i:] + } + log.Debugf("Set %s.%d as static to %s in %s address cache\n", nic, jail.JID, printablemac, bridge) + cmd = fmt.Sprintf("/sbin/ifconfig %s static %s.%d %s", bridge, nic, jail.JID, printablemac) out, err := executeCommand(cmd) if err != nil { - return fmt.Errorf("Error adding member %s to %s: %v: %s\n", nic, bridge, err, out) + return fmt.Errorf("Error setting %s.%d static with %s on %s: %v: %s\n", nic, jail.JID, printablemac, bridge, err, out) } } }