summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* dbg: save errno from modification in NL_DBG()Thomas Haller2015-03-051-1/+4
| | | | | | | Evaluating the logging statement might overwrite the errno. Save and restore it so that NL_DBG() preserves the errno. Signed-off-by: Thomas Haller <thaller@redhat.com>
* cls: add rtnl_u32_get_classid() APICong Wang2015-03-043-0/+16
| | | | | | | | | [thaller@redhat.com: modified patch to use rtnl_tc_data_peek()] http://lists.infradead.org/pipermail/libnl/2015-March/001841.html Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* build/trivial: reorder symbols in linker version scripts and add commentThomas Haller2015-03-045-41/+68
| | | | | | | | | | | | | | | | We export some symbols that are in private headers. We shouldn't do that. Highlight them in the version script by grouping them and add a comment. We might want to hide these symbols later. Some of these symbols symbols are used by libnl internal libraries. So removing those is more complicated and only possible if we don't required compatibility of different libnl libraries between each other (i.e. that we require that within one installation the library versions match). Signed-off-by: Thomas Haller <thaller@redhat.com>
* route/tc: add internal rtnl_tc_data_peek() functionThomas Haller2015-03-042-0/+14
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* correct --protocol option for nl-cls-* utilitiesCong Wang2015-02-253-3/+3
| | | | | | | Just in the help message. Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* act: correct file path for mirred.cCong Wang2015-02-251-1/+1
| | | | | Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* build: fix parallel makeLubomir Rintel2015-02-181-0/+5
| | | | | | | | | | Add missing inter-library dependencies. Fixes: e7d57da0ddad9097962ebfec4f5202b756ed93c9 https://github.com/thom311/libnl/pull/69 Signed-off-by: Thomas Haller <thaller@redhat.com>
* pktloc: fix typo for tcp.flag.synThomas Haller2015-02-171-1/+1
| | | | | | | | | http://lists.infradead.org/pipermail/libnl/2015-February/001829.html http://lists.infradead.org/pipermail/libnl/2015-February/001830.html Reported-by: Georgi Chulkov <georgi@guinpen.eu> Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* lib: log errors from platformLubomir Rintel2015-02-173-11/+72
| | | | | | | | | | | | nl_syserr2nlerr() reduces a lot of platform errors to NLE_FAILURE -- "Unspecific failure" which makes it somehow hard to track down the real reason behind a failure. Logging them with level of 4 makes it a little less painful. https://github.com/thom311/libnl/pull/65 Signed-off-by: Thomas Haller <thaller@redhat.com>
* lib: add const-ness to appropriate parameters in addr, attr, dataRohan Joyce2015-02-166-98/+107
| | | | | | | | | | | | | | | This patch changes the signatures of some functions to allow const pointers in places where a const qualified pointer is enough access for what the function does (e.g. nla_get_u8). It also changes some functions that take a pointer parameter and return a pointer derived from it to use the strchr idiom. This is not exhaustive in terms of places where const can be added, but it's a decent chunk that should not make the external api any more restrictive. http://lists.infradead.org/pipermail/libnl/2015-February/001826.html Signed-off-by: Rohan Joyce <rojoyce.github@gmail.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* route/tc: add rtnl_tc_stat2str() and rtnl_tc_str2stat()Cong Wang2015-02-023-0/+26
| | | | | | | [thaller@redhat.com: add symbols to libnl-route-3.sym] Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* route/act: merge branch 'act-skbedit'Thomas Haller2015-02-028-10/+415
|\ | | | | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
| * route/act: add a test case for skbedit actionCong Wang2015-02-021-10/+21
| | | | | | | | | | Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
| * route/act: add skbedit actionCong Wang2015-02-027-0/+394
|/ | | | | | | [thaller@redhat.com: changed whitespace and libnl-route.sym] Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* build: merge branch 'symbol-versioning'Thomas Haller2015-02-0213-14/+2038
|\ | | | | | | | | | | | | | | | | | | | | | | | | No longer export all symbols of the shared libraries but pick them explicitly. Hide symbols that were private and not part of a public header file. This is an ABI change, but hopefully not too painful. There are still symbols in the header files that should be private. They continue to be exposed. http://lists.infradead.org/pipermail/libnl/2015-January/001794.html
| * build: don't export internal symbolsThomas Haller2015-02-027-109/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Hide internal symbols from the libraries. Before, all symbols were exported, including some that were not meant to be public. Hide them now. This is an ABI break, but nobody was supposed to use these symbols. Hence it seems acceptable to hide them now. Still don't hide any symbols that are internal, but wrongly exported in public header files (such as @ct_obj_ops). Signed-off-by: Thomas Haller <thaller@redhat.com>
| * build: move linker script symbols since last stable release to own sectionThomas Haller2015-02-022-18/+26
| | | | | | | | | | | | | | Move the symbols that were added since the last stable release to a new section of the linker file. Signed-off-by: Thomas Haller <thaller@redhat.com>
| * build: explicitly list exported symbols in linker scriptsThomas Haller2015-02-027-5/+2066
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before all symbols (global: *;) were exported, which included some symbols that should not be exported. Update the symbol files to exclude everything by default and name the exported symbols explicitly. Still the same symbols as before are exported. for SO in ./lib/.libs/*.so ./src/lib/.libs/*.so; do SYM="$(basename "$SO")" SYM="${SYM%.so}.sym" cat <<EOF | sed 's/^ *>> //' > "$SYM" >> libnl_3 { >> global: >> $(nm "$SO" | sed -n 's/^[a-fA-F0-9]\+ [BDRT] \(.*\)/\t\1;/p' | LANG=C sort) >> local: >> $(echo -e '\t')*; >> }; EOF done Signed-off-by: Thomas Haller <thaller@redhat.com>
| * build: add linker scripts for libnl-cli-3.so libraryThomas Haller2015-02-023-0/+11
| | | | | | | | | | | | | | libnl-cli-3.so was unversioned previously. This is an ABI change (but backward compatible). Signed-off-by: Thomas Haller <thaller@redhat.com>
| * build: add individual linker version scripts for shared librariesThomas Haller2015-02-0210-6/+59
|/ | | | | | | | | | Instead of using a shared version script 'libnl.sym', add individual linker scripts for all libnl libraries. For now, the content of the version script is unchanged and this patch does not have any externally visible changes. Signed-off-by: Thomas Haller <thaller@redhat.com>
* python: fix package meta data in setup.pyThomas Haller2015-01-121-0/+4
| | | | | | | http://lists.infradead.org/pipermail/libnl/2015-January/001802.html Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* build: mark header linux-private/linux/veth.h as noinst_HEADERSThomas Haller2014-12-091-0/+1
| | | | Fixes: 9dc6e6da90016a33929f262bea0187396e1a061b
* idiag: fix set of identifying properties for idiag_msg_objThomas Haller2014-11-271-5/+17
| | | | | | | | | The key for a struct idiag_msg_obj should be 'family x src x dst x sport x dport'. http://lists.infradead.org/pipermail/libnl/2014-November/001768.html Signed-off-by: Thomas Haller <thaller@redhat.com>
* idiag: merge branch 'idiag-compare-all'Thomas Haller2014-11-273-26/+76
|\ | | | | | | | | | | | | | | | | oo_compare() is also relevant for nl_object_diff() and nl_object_filter(). Compare all fields so that comparing idiag_meminfo_obj works properly. http://lists.infradead.org/pipermail/libnl/2014-November/001783.html Signed-off-by: Thomas Haller <thaller@redhat.com>
| * idiag: fix idiagnl_compare() to compare all attributesThomas Haller2014-11-271-4/+22
| | | | | | | | | | | | | | | | | | This is not important for nl_object_identical() which only considers the required attributes. But for using nl_object_diff() or nl_object_filter(), all attributes must be compared. Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
| * idiag: make objects 'idiag_vegasinfo' and 'idiag_meminfo' comparableThomas Haller2014-11-272-0/+30
| | | | | | | | | | Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
| * idiag: don't dump unset properties of idiag_msgThomas Haller2014-11-271-22/+24
|/ | | | | Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* route/addr: consider CACHEINFO in addr_compare()/nl_object_diff()Thomas Haller2014-11-273-1/+11
| | | | | | | | | | | Indicate this change of behavior with the capability NL_CAPABILITY_ROUTE_ADDR_COMPARE_CACHEINFO. This is a behavioral change as we now consider an additional field when comparing addresses. Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* object: fix returning UINT_MAX for uint32_t in nl_object_diff()Thomas Haller2014-11-271-2/+2
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* route: merge branch 'route-link-get-kernel-opnotsupp'Thomas Haller2014-11-275-11/+71
|\ | | | | | | | | | | http://lists.infradead.org/pipermail/libnl/2014-November/001769.html Signed-off-by: Thomas Haller <thaller@redhat.com>
| * route/link: return -NLE_OPNOTSUPP in rtnl_link_get_kernel() for old kernelsThomas Haller2014-11-273-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | Older kernels without patch a3d1289126e7b14307074b76bf1677015ea5036f do not support rtnl_getlink() by ifname. Detect this situation and fail with -NLE_OPNOTSUPP instead of -NLE_INVAL. This changes behavior in returning a different error code for this case. Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
| * nl: add function nl_pickup_keep_syserr()Thomas Haller2014-11-272-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | nl_pickup() converts error codes from netlink into nl error codes using nl_syserr2nlerr(). The latter function mangles different error codes to the same nl error code. Add a new function, that returns both the nl error code and the original error code. Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
| * trival: white space fix in lib/nl.cThomas Haller2014-11-271-9/+9
|/ | | | | Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* idiag: merge branch 'idiag-exts2str-fix'Thomas Haller2014-11-251-9/+22
|\ | | | | | | | | | | http://lists.infradead.org/pipermail/libnl/2014-November/001762.html Signed-off-by: Thomas Haller <thaller@redhat.com>
| * idiag: fix idiagnl_exts2str()Thomas Haller2014-11-251-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | idiagnl_exts2str() is used to print req->idiag_ext, which is the extention types combined as flags, such as ( (1 << (INET_DIAG_TOS - 1)) | (1 << (INET_DIAG_MEMINFO - 1)) ). This function was wrong from the beginning because the string lookup array had indexes such as 'INET_DIAG_TOS', instead of '(1 << (INET_DIAG_TOS - 1)'. Fix also idiagnl_attrs2str() which now converts an extension type (e.g. INET_DIAG_TOS) to a string. Still this function is deprecated, as the function name is not clear and it is not used or very useful. Fixes: 22eb2569a595be98ae09fc4192860c1d2c3aa54c Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
| * idiag: add missing enum types for idiagnl_exts2str()Thomas Haller2014-11-251-0/+2
|/ | | | | Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* cache: assert in nl_cache_mngt_register() for valid oo_keygen() functionThomas Haller2014-11-251-0/+3
| | | | | | | | | oo_keygen() requires oo_compare(). Assert in nl_cache_mngt_register(). http://lists.infradead.org/pipermail/libnl/2014-November/001759.html Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* idiag: merge branch 'idiag-fixes'Thomas Haller2014-11-249-154/+449
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deprecate all of the IDIAG_* defines in 'idiagnl.h'. Names exposed by libnl should have the prefix IDIAGNL_* instead. But actually, most of these values were copies from other system headers. The user should instead use the original defines anyway. Also, several fixes of the idiag_msg_obj, which had a broken oo_clone() function and missing oo_compare(). http://lists.infradead.org/pipermail/libnl/2014-November/001726.html Signed-off-by: Thomas Haller <thaller@redhat.com>
| * idiag: add a oo_compare() function for idiag_msg objectsThomas Haller2014-11-241-0/+17
| | | | | | | | | | | | | | | | | | | | Having a oo_keygen() function only makes sense together with a oo_compare() function because after hashing, you still have to compare the objects for equality (in case of hash collission). Fixes: 9c066b9271493ce3efff0b9d7b6e424990bba3f2 Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
| * idiag: add change attributes for idiag_msg_objThomas Haller2014-11-241-14/+127
| | | | | | | | | | Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
| * idiag: remove clone functions from trivial structuresThomas Haller2014-11-242-23/+0
| | | | | | | | | | | | | | | | A oo_clone() function is only needed for complex sturctures to deep copy an object. Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
| * idiag: fix idiagnl_msg_clone()Thomas Haller2014-11-241-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For one, we did not clone all pointer values. Hence, every cloned object was very broken and resulted in dangling pointers and double free/unref. Apparently nobody was really using this function up to now. Also, fix the return cases for NLE_NOMEM, so that we did not assume ownership of pointers in 'src'. Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
| * idiag: fix memory leak in idiagnl_msg_set_cong()Thomas Haller2014-11-241-0/+1
| | | | | | | | | | Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
| * idiag: reorder idiagnl.h to have deprecated functions at the topThomas Haller2014-11-241-7/+14
| | | | | | | | | | Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
| * idiag: deprecate IDIAG_TIMER_* value for IDIAGNL_TIMER_*Thomas Haller2014-11-242-13/+21
| | | | | | | | | | Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
| * idiag: deprecate IDIAG_SS_* socket statesThomas Haller2014-11-243-30/+38
| | | | | | | | | | | | | | | | | | | | These values mirror TCP_* socket states from 'netinit/tcp.h'. There is no good reason to expose a copy of those values. User space should use the original values (if they care). The only value that is actually useful is IDIAGNL_SS_ALL. Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
| * idiag: deprecate netlink message type defines in idiagnl.hThomas Haller2014-11-242-2/+5
| | | | | | | | | | Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
| * idiag: deprecate IDIAG_ATTR_* enumerationThomas Haller2014-11-243-78/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IDIAG_ATTR_* were a copy of the INET_DIAG_* extension kernel flags. Redefining them is wrong, user space should continue to use the values provided via the kernel headers. Also they were misused as change flags (ce_mask), which they are not. Deprecate the IDIAG_ATTR_* flags and redefine them to what the originally are: INET_DIAG_*. Also deprecated idiagnl_attrs2str() because there is already idiagnl_exts2str(). idiagnl_attrs2str() in the sense of libnl change flags (ce_mask) makes no sense. Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
| * idiag: deprecate idiagnl_msg_obj_ops variable in public APIThomas Haller2014-11-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | This internal structure should never have been exposed publically. It as introduced as public API in v3.2.23. For now, don't remove it as it would be an API/ABI break. Fixes: 81d2b1d509d91fe894e4aec0a6a76b0bf75514cd Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
| * idiag: fix out of bound error parsing idiag messagesThomas Haller2014-11-241-1/+1
| | | | | | | | | | Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>