X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fnetdev.c;h=5aae01c6c21ba03a73ef9f70f980d6e14d76d637;hb=0bb0393a0b274776ebd61ca2265a252ac8dfbe2a;hp=5c2e9f55e7149862b3802c71dc06fd9a07cd5bda;hpb=22bb3cbc197cbef061c8c2213c64d435fe248d17;p=sliver-openvswitch.git diff --git a/lib/netdev.c b/lib/netdev.c index 5c2e9f55e..5aae01c6c 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -277,6 +277,17 @@ netdev_open(const char *name, const char *type, struct netdev **netdevp) return 0; } +/* Returns a reference to 'netdev_' for the caller to own. */ +struct netdev * +netdev_ref(const struct netdev *netdev_) +{ + struct netdev *netdev = CONST_CAST(struct netdev *, netdev_); + + ovs_assert(netdev->ref_cnt > 0); + netdev->ref_cnt++; + return netdev; +} + /* Reconfigures the device 'netdev' with 'args'. 'args' may be empty * or NULL if none are needed. */ int