bridge: remove useless firstV4Addr

Signed-off-by: arthur-zhang <zhangya_no1@qq.com>
This commit is contained in:
arthur-zhang 2023-10-26 10:28:55 +08:00 committed by Casey Callendrello
parent 8c59fc1eea
commit 495a2cbb0c

View File

@ -629,14 +629,10 @@ func cmdAdd(args *skel.CmdArgs) error {
}
if n.IsGW {
var firstV4Addr net.IP
var vlanInterface *current.Interface
// Set the IP address(es) on the bridge and enable forwarding
for _, gws := range []*gwInfo{gwsV4, gwsV6} {
for _, gw := range gws.gws {
if gw.IP.To4() != nil && firstV4Addr == nil {
firstV4Addr = gw.IP
}
if n.Vlan != 0 {
vlanIface, err := ensureVlanInterface(br, n.Vlan, n.PreserveDefaultVlan)
if err != nil {