|
@@ -6,7 +6,7 @@ import (
|
|
"github.com/vishvananda/netlink"
|
|
"github.com/vishvananda/netlink"
|
|
)
|
|
)
|
|
|
|
|
|
-func setupVerifyConfiguredAddresses(config *Configuration, i *bridgeInterface) error {
|
|
|
|
|
|
+func setupVerifyAndReconcile(config *Configuration, i *bridgeInterface) error {
|
|
// Fetch a single IPv4 and a slice of IPv6 addresses from the bridge.
|
|
// Fetch a single IPv4 and a slice of IPv6 addresses from the bridge.
|
|
addrv4, addrsv6, err := i.addresses()
|
|
addrv4, addrsv6, err := i.addresses()
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -29,6 +29,12 @@ func setupVerifyConfiguredAddresses(config *Configuration, i *bridgeInterface) e
|
|
return fmt.Errorf("Bridge IPv6 addresses do not match the expected bridge configuration %s", bridgeIPv6)
|
|
return fmt.Errorf("Bridge IPv6 addresses do not match the expected bridge configuration %s", bridgeIPv6)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // By this time we have either configured a new bridge with an IP address
|
|
|
|
+ // or made sure an existing bridge's IP matches the configuration
|
|
|
|
+ // Now is the time to cache these states in the bridgeInterface.
|
|
|
|
+ i.bridgeIPv4 = addrv4.IPNet
|
|
|
|
+ i.bridgeIPv6 = bridgeIPv6
|
|
|
|
+
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|