diff options
author | David Sommerseth <davids@redhat.com> | 2011-04-11 16:36:56 +0200 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2011-04-11 16:36:56 +0200 |
commit | 508ffffbb3c48eeeb11eeab2bf971180fe4e1940 (patch) | |
tree | 2b8133c62a904fd400f0cef0a3e2abb12048149a /python-ethtool/etherinfo_struct.h | |
parent | abc7f912f66d41dd734a10900429d4cad9377da5 (diff) | |
download | python-ethtool-508ffffbb3c48eeeb11eeab2bf971180fe4e1940.tar.gz python-ethtool-508ffffbb3c48eeeb11eeab2bf971180fe4e1940.tar.xz python-ethtool-508ffffbb3c48eeeb11eeab2bf971180fe4e1940.zip |
Only open the NETLINK interface when needed
Do not open a NETLINK connection when loading the module, but rahter
open it when needed. In a case where multiple users needs the
connection, it will be shared and only closed when the last active
user is done.
Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'python-ethtool/etherinfo_struct.h')
-rw-r--r-- | python-ethtool/etherinfo_struct.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/python-ethtool/etherinfo_struct.h b/python-ethtool/etherinfo_struct.h index 3ae037f..f294637 100644 --- a/python-ethtool/etherinfo_struct.h +++ b/python-ethtool/etherinfo_struct.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2010 Red Hat Inc. + * Copyright (C) 2009-2011 Red Hat Inc. * * David Sommerseth <davids@redhat.com> * @@ -58,7 +58,9 @@ struct ipv6address { * */ struct etherinfo_obj_data { - struct nl_handle *nlc; /**< Contains NETLINK connection info */ + struct nl_handle **nlc; /**< Contains NETLINK connection info (global) */ + unsigned int *nlc_users; /**< Resource counter for the NETLINK connection (global) */ + unsigned short nlc_active; /**< Is this instance using NETLINK? */ struct etherinfo *ethinfo; /**< Contains info about our current interface */ }; |