]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/netdev: introduce .is_ready_to_create() entry in netdev vtable
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 6 Dec 2021 20:25:09 +0000 (05:25 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 12 Dec 2021 04:41:39 +0000 (13:41 +0900)
src/network/netdev/netdev.c
src/network/netdev/netdev.h

index 8e7fe11c182e3ac2dcffac00f5c7fbe6ff5d21eb..97d06a0d167c4c6c0081075da15f7799c57e455b 100644 (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;
 }
 
index c7262f550a527cf6095e8bbbee16970b86332da9..b631e8e23ff55615f971ec38fdf80f37054c8bb2 100644 (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);