aboutsummaryrefslogtreecommitdiffstats
path: root/testing/py-ethtool/python-ethtool-libnl-1.0-support.patch
diff options
context:
space:
mode:
authorFrancesco Colista <francesco.colista@gmail.com>2012-03-20 12:26:52 +0000
committerFrancesco Colista <francesco.colista@gmail.com>2012-03-20 12:26:52 +0000
commit7d8df3859347c83a347c3c771a3bd438e17a3d44 (patch)
tree7750a9299feb7e8dafdba79f5755160933fc554f /testing/py-ethtool/python-ethtool-libnl-1.0-support.patch
parentb06fd02ab6d73b7167cdafbb3d2623afacdb1303 (diff)
parent01a790374524c25b6730fd48ae70bb6c31a65361 (diff)
downloadaports-7d8df3859347c83a347c3c771a3bd438e17a3d44.tar.bz2
aports-7d8df3859347c83a347c3c771a3bd438e17a3d44.tar.xz
Merge git://dev.alpinelinux.org/aports
Diffstat (limited to 'testing/py-ethtool/python-ethtool-libnl-1.0-support.patch')
-rw-r--r--testing/py-ethtool/python-ethtool-libnl-1.0-support.patch71
1 files changed, 71 insertions, 0 deletions
diff --git a/testing/py-ethtool/python-ethtool-libnl-1.0-support.patch b/testing/py-ethtool/python-ethtool-libnl-1.0-support.patch
new file mode 100644
index 0000000000..43c53dba4e
--- /dev/null
+++ b/testing/py-ethtool/python-ethtool-libnl-1.0-support.patch
@@ -0,0 +1,71 @@
+diff --git a/python-ethtool/etherinfo.c b/python-ethtool/etherinfo.c
+index 3d2072b..23f03c6 100644
+--- a/python-ethtool/etherinfo.c
++++ b/python-ethtool/etherinfo.c
+@@ -30,6 +30,52 @@
+ #include "etherinfo_struct.h"
+ #include "etherinfo.h"
+
++#ifdef LIBNL_1_0
++#define NLHDR_COMMON \
++ int ce_refcnt; \
++ struct nl_object_ops * ce_ops; \
++ struct nl_cache * ce_cache; \
++ struct nl_list_head ce_list; \
++ int ce_msgtype; \
++ int ce_flags; \
++ uint32_t ce_mask;
++
++struct nl_cache
++{
++ struct nl_list_head c_items;
++ int c_nitems;
++ int c_iarg1;
++ int c_iarg2;
++ struct nl_cache_ops * c_ops;
++};
++
++struct nl_object
++{
++ NLHDR_COMMON
++};
++
++void nl_cache_free(struct nl_cache *cache)
++{
++ struct nl_object *obj, *tmp;
++
++ if( !cache )
++ return;
++
++ nl_list_for_each_entry_safe(obj, tmp, &cache->c_items, ce_list) {
++ struct nl_cache *cache = obj->ce_cache;
++ if( !cache ) {
++ break;
++ }
++
++ nl_list_del(&obj->ce_list);
++ obj->ce_cache = NULL;
++ nl_object_put(obj);
++ cache->c_nitems--;
++ }
++ free(cache);
++}
++#endif
++
+ /*
+ *
+ * Internal functions for working with struct etherinfo
+diff --git a/setup.py b/setup.py
+index bde04dc..9adff64 100644
+--- a/setup.py
++++ b/setup.py
+@@ -67,7 +67,8 @@ setup(name='ethtool',
+ include_dirs = libnl['include'],
+ library_dirs = libnl['libdirs'],
+ libraries = libnl['libs'],
+- define_macros = [('VERSION', '"%s"' % version)]
++ define_macros = [('VERSION', '"%s"' % version),
++ ('LIBNL_1_0', None)]
+ )
+ ]
+ )