Skip to content

Commit adc3e6b

Browse files
Amulyam24mlguerrero12
authored andcommitted
bridge: include attempted IP address in AddrAdd error message
This PR includes the IP in the `AddrAdd` error message which could help debug better with any issues while adding the IP address to the bridge and improves the readability. Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
1 parent 4161e44 commit adc3e6b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

plugins/main/bridge/bridge.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ func ensureAddr(br netlink.Link, family int, ipn *net.IPNet, forceAddress bool)
295295

296296
addr := &netlink.Addr{IPNet: ipn, Label: ""}
297297
if err := netlink.AddrAdd(br, addr); err != nil && err != syscall.EEXIST {
298-
return fmt.Errorf("could not add IP address to %q: %v", br.Attrs().Name, err)
298+
return fmt.Errorf("could not add IP address %s to %q: %v", ipnStr, br.Attrs().Name, err)
299299
}
300300

301301
// Set the bridge's MAC to itself. Otherwise, the bridge will take the

0 commit comments

Comments
 (0)