Skip to content

Commit 7886f8b

Browse files
committed
cnetlink: initialize new ports to down
Any newly created interface will start as being down, so we should make sure that the configuration in the switch reflects that. Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
1 parent b11e88f commit 7886f8b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/netlink/cnetlink.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,11 +1352,15 @@ void cnetlink::link_created(rtnl_link *link) noexcept {
13521352
} break;
13531353
default: {
13541354
bool handled = port_man->portdev_ready(link);
1355-
if (handled)
1355+
if (handled) {
1356+
uint32_t port_id = get_port_id(link);
1357+
13561358
port_man->set_offloaded(link, FLAGS_mark_fwd_offload);
1357-
else
1359+
swi->port_set_config(port_id, port_man->get_hwaddr(port_id), false);
1360+
} else {
13581361
LOG(WARNING) << __FUNCTION__ << ": ignoring link with lt=" << lt
13591362
<< " link:" << OBJ_CAST(link);
1363+
}
13601364
} break;
13611365
} // switch link type
13621366
}

0 commit comments

Comments
 (0)