1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-28 02:50:16 +03:00

network/netdev: introduce .is_ready_to_create() entry in netdev vtable

This commit is contained in:
Yu Watanabe 2021-12-07 05:25:09 +09:00
parent d2a58f0edb
commit 562729d744
2 changed files with 6 additions and 0 deletions

View File

@ -628,6 +628,9 @@ static bool netdev_is_ready_to_create(NetDev *netdev, Link *link) {
if (link->set_link_messages > 0)
return false;
if (NETDEV_VTABLE(netdev)->is_ready_to_create)
return NETDEV_VTABLE(netdev)->is_ready_to_create(netdev, link);
return true;
}

View File

@ -153,6 +153,9 @@ typedef struct NetDevVTable {
/* specifies if netdev is independent, or a master device or a stacked device */
NetDevCreateType create_type;
/* This is used for stacked netdev. Return true when the underlying link is ready. */
int (*is_ready_to_create)(NetDev *netdev, Link *link);
/* create netdev, if not done via rtnl */
int (*create)(NetDev *netdev);