summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* route: sort entries in libnl-route-3.sym by nameThomas Haller2016-04-151-3/+3
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* build: move -rdynamic from CPPFLAGS to LDFLAGSTobias Klauser2016-03-311-2/+2
| | | | | | | | | | The -rdynamic flag is a linker flag, not a compiler/preprocessor flag, so move it to LDFLAGS. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Thomas Haller <thaller@redhat.com> http://lists.infradead.org/pipermail/libnl/2016-March/002100.html
* lib: add type casting for nla_for_each_nested macroPrzemyslaw Szczerbik2016-02-251-1/+1
| | | | | | | | | | | g++ is unable to compile code with nla_for_each_nested macro due to implicit type conversion from void* to nlattr*. This patch adds type casting for nla_for_each_nested macro to address this issue. Signed-off-by: Przemyslaw Szczerbik <przemek.szczerbik@gmail.com> Signed-off-by: Thomas Haller <thaller@redhat.com> http://lists.infradead.org/pipermail/libnl/2016-February/002095.html
* lib: merge branch 'nl-object-diff64'Thomas Haller2016-02-1228-65/+111
|\ | | | | | | | | | | | | http://lists.infradead.org/pipermail/libnl/2015-December/002078.html http://lists.infradead.org/pipermail/libnl/2015-December/002083.html Signed-off-by: Thomas Haller <thaller@redhat.com>
| * lib/utils: add NL_CAPABILITY_NL_OBJECT_DIFF64 capabilityThomas Haller2016-02-122-1/+7
| | | | | | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
| * libnl: add nl_object_diff64() to libnl-3.symThomas Haller2016-02-121-0/+5
| | | | | | | | | | | | Fixes: a09b8558148b31e469d463907d103fa78d81612c Signed-off-by: Thomas Haller <thaller@redhat.com>
| * lib: update ce-mask to uint64_tDavid Ahern2016-02-1225-64/+99
|/ | | | | | | | | | | | | | | | | | | | lib/route/link.c already defines 32 attributes which fills the current uint32_t used for ce_mask. To accommodate more attributes the mask needs to be expanded. This patch updates the definition to uint64_t. The nl_object_diff API is maintained for ABI with existing users. A new nl_object_diff64 API is added for the expanded attribute list. The MSB of the 32-bit API is used to indicate if higher order attributes had a mismatch. (Suggested by Thomas). Note that LINK_ATTR_LINK_NETNSID changes. But since the attribute flags are not public API it shouldn't be a problem. http://lists.infradead.org/pipermail/libnl/2015-December/002078.html http://lists.infradead.org/pipermail/libnl/2015-December/002083.html Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* remove null dereference from netlink/link.hNick Lewycky2016-02-121-1/+3
| | | | | | | | | Replace a null pointer dereference with a use of the 'offsetof' macro in stddef.h. http://lists.infradead.org/pipermail/libnl/2016-January/002085.html Signed-off-by: Nick Lewycky <nlewycky@google.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* lib/route: potential memory leak in pktloc.cAmit Khatri2015-12-181-2/+4
| | | | | | | | | | | | | In scneario, where file modification time is unchanged, code is returning 0 form read_pktlocs(). It causes memory leak for path variable. Memory for this variable is allocated inside build_sysconf_path() by asprintf() function. http://lists.infradead.org/pipermail/libnl/2015-December/002079.html Signed-off-by: Amit Khatri <amit.khatri@samsung.com> Signed-off-by: Rahul Jain <rahul.jain@samsung.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* route/link: add support for IN6_ADDR_GEN_MODE_STABLE_PRIVACYQuentin Armitage2015-12-181-0/+1
| | | | | | | | | IN6_ADDR_GEN_MODE_STABLE_PRIVACY was introduced in Linux 4.1 https://github.com/thom311/libnl/pull/95 Signed-off-by: Quentin Armitage <quentin@armitage.org.uk> Signed-off-by: Thomas Haller <thaller@redhat.com>
* route/link/bridge: fixed return typeTobias Jungel2015-12-161-1/+1
| | | | | | Fixes: 6555b0d https://github.com/thom311/libnl/pull/94
* route/bridge: merge branch 'bridge-vlan'Thomas Haller2015-12-0711-28/+1136
|\ | | | | | | | | | | | | | | | | Add support for vlan attributes for bridges. http://lists.infradead.org/pipermail/libnl/2015-November/002032.html http://lists.infradead.org/pipermail/libnl/2015-November/002047.html Signed-off-by: Thomas Haller <thaller@redhat.com>
| * route/link: handle RTEXT_FILTER_BRVLAN_COMPRESSEDTobias Jungel2015-12-071-9/+28
| | | | | | | | | | | | | | notifications from the kernel regarding vlan ids are now handled [thaller@redhat.com: split ao_parse_af_full() to previous patch] Signed-off-by: Thomas Haller <thaller@redhat.com>
| * bridge: add support for VLANsDavid Ahern2015-12-074-2/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add operation for requesting VLAN data for AF_BRIDGE and parsing of IFLA_AF_SPEC for AF_BRIDGE. VLANs are saved in a bitmap. Also add dumping of vlan info to link list and neigh list. For example: $ nl-link-list --details --family=bridge br1 ether 8e:6e:0e:86:e5:86 master br1 <broadcast,multicast,up,running,lowerup> mtu 1500 txqlen 0 weight 0 index 18 mode default carrier down bridge: pvid 1 all vlans: 1 301-400 601-610 untagged vlans: 1 bond1 ether 46:ef:e1:c9:46:fe <broadcast,multicast,master> mtu 1500 txqlen 0 weight 0 index 20 state down mode default carrier down bridge: Signed-off-by: Wilson Kok <wkok@cumulusnetworks.com> Signed-off-by: David Ahern <dsa@cumulusnetworks.com> [thaller@redhat.com: modified original patch to use ao_parse_af_full(). Also renaming new API and drop some #defines] Signed-off-by: Thomas Haller <thaller@redhat.com>
| * include/linux: update copy of kernel headersThomas Haller2015-12-075-12/+831
| | | | | | | | | | | | | | Taken from upstream kernel commit 6a13feb9c82803e2b815eca72fa7a9f5561d7861 (v4.3)). Signed-off-by: Thomas Haller <thaller@redhat.com>
| * lib: handle family-based parsing of IFLA_AF_SPEC attributeDavid Ahern2015-12-072-13/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The encoding of the IFLA_AF_SPEC attribute varies depending on the family used for the request (RTM_GETLINK) message. For AF_UNSPEC the encoding has another level of nesting for each address family with the type encoded first. i.e., af_spec = nla_nest_start(skb, IFLA_AF_SPEC) for each family: af = nla_nest_start(skb, af_ops->family) af_ops->fill_link_af(skb, dev, ext_filter_mask) nest_end nest_end This allows the parser to find the address family by looking at the first type. Whereas AF_BRIDGE encoding is just: af_spec = nla_nest_start(skb, IFLA_AF_SPEC) br_fill_ifvlaninfo{_compressed}(skb, vg) nest_end which means the parser can not use the attribute itself to know the family to which the attribute belongs. Signed-off-by: David Ahern <dsa@cumulusnetworks.com> [thaller@redhat.com: refactor code by merging a later patch by tobias.jungel@bisdn.de and introduce new function ao_parse_af_full()] Signed-off-by: Thomas Haller <thaller@redhat.com>
| * link: add AF operation to append attributes to a GETLINK messageDavid Ahern2015-12-072-1/+29
|/ | | | | | | | | | | Upcoming bridge patch wants to add IFLA_EXT_MASK attribute to RTM_GETLINK requests to retrieve VLAN data. Expand request message to a full ifinfomsg header and call to hook to append attributes if it exists for an address family. Signed-off-by: David Ahern <dsa@cumulusnetworks.com> [thaller@redhat.com: fix memleak in link_request_update()] Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnl: don't use out-of-scope buffer in nl_send_iovec()Andrew Vagin2015-11-241-1/+1
| | | | | | | | | | The control message buffer is desclared in the if body and then this buffer is used outside. http://lists.infradead.org/pipermail/libnl/2015-November/002013.html Signed-off-by: Andrew Vagin <avagin@virtuozzo.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* route/link/vxlan: merge branch 'vxlan-io-compare'Thomas Haller2015-11-206-103/+167
|\ | | | | | | http://lists.infradead.org/pipermail/libnl/2015-October/001997.html
| * route/link/vxlan: add support for link_info compareDavid Ahern2015-11-203-1/+36
| | | | | | | | | | | | | | Signed-off-by: Balki Raman <ramanb@cumulusnetworks.com> Signed-off-by: David Ahern <dsa@cumulusnetworks.com> [thaller@redhat.com: whitespace, add capability, consider local6/group6] Signed-off-by: Thomas Haller <thaller@redhat.com>
| * route/link/vxlan: trivial rename VXLAN_HAS_ prefix and vxi_maskDavid Ahern2015-11-201-102/+102
| | | | | | | | | | | | | | | | | | | | | | Global search and replace of VXLAN_HAS_ for VXLAN_ATTR_ and vxi_mask for ce_mask. Preparation step for using ATTR_DIFF infrastructure in a vxlan_compare. Signed-off-by: Balki Raman <ramanb@cumulusnetworks.com> Signed-off-by: David Ahern <dsa@cumulusnetworks.com> [thaller@redhat.com: rebased patch and changed whitespace] Signed-off-by: Thomas Haller <thaller@redhat.com>
| * route/link: add link info compare operationDavid Ahern2015-11-203-0/+29
|/ | | | | | Signed-off-by: Balki Raman <ramanb@cumulusnetworks.com> Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* route/link: corrected array size for inet_policyTobias Jungel2015-11-191-1/+1
| | | | | | | | Using now the macro for inet instead of inet6 Fixes: 53015f83811bd56d4b66331656633ad39051babf https://github.com/thom311/libnl/pull/92
* route/link: merge branch 'bg/vxlan-ipv6'Thomas Haller2015-11-198-27/+132
|\ | | | | | | | | | | http://lists.infradead.org/pipermail/libnl/2015-October/001981.html Signed-off-by: Thomas Haller <thaller@redhat.com>
| * route/link: add ipv6 support to vxlan linksBeniamino Galvani2015-11-191-21/+78
| | | | | | | | | | | | | | | | Extend vxlan links to support the IFLA_VXLAN_GROUP6 and IFLA_VXLAN_LOCAL6 attributes used to represent IPv6 endpoints. Signed-off-by: Beniamino Galvani <bgalvani@redhat.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
| * route/link: fix dump of parent link for some link typesBeniamino Galvani2015-11-198-6/+54
|/ | | | | | | | Some link types incorrectly dump their own interface name as parent link; fix this. Signed-off-by: Beniamino Galvani <bgalvani@redhat.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* route/link: add macvtap supportBeniamino Galvani2015-11-198-12/+357
| | | | | | | | | This adds support for MAC-VLAN based tap interfaces (macvtap). http://lists.infradead.org/pipermail/libnl/2015-October/001976.html Signed-off-by: Beniamino Galvani <bgalvani@redhat.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* gitignore: ignore test binaries in "tests/"Thomas Haller2015-11-191-1/+3
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* link/neigh: add flags option to link and neighbor cachesDavid Ahern2015-11-1912-6/+127
| | | | | | | | | | | | | Both link and neighbor cache support specify multiple groups (nl_af_group), but the alloc_cache functions for both do not set the NL_CACHE_AF_ITER flag before populating the cache so only the first group is used by default. This patch adds an API to pass in flags to make that happen and updates the nl-neigh-list command to make use of it. http://lists.infradead.org/pipermail/libnl/2015-October/001996.html Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* route/vlan: allow clearing vlan ingress mapThomas Haller2015-11-193-3/+25
| | | | | | | | | | | | | | | | | | | | | An entry of the ingress map can be cleared by setting the "to" part to zero. Previously, vlan_put_attrs() would skip over zero "to" and thus the user cannot unset an ingress map entry. Add a modified-mask to record the state of each ingress map entry and also sent explicit zeros to kernel. when we receive a IFLA_VLAN_INGRESS_QOS message from kernel, vlan_parse() similarly sets the received entries as modified. This preserves previous behavior when using a received object to modify a vlan. Add a capability NL_CAPABILITY_RTNL_LINK_VLAN_INGRESS_MAP_CLEAR to indicate the behavioral change. Signed-off-by: Thomas Haller <thaller@redhat.com>
* route/link: fix parsing of 'remote' attribute for GRE linksBeniamino Galvani2015-11-193-3/+9
| | | | | | | | | | Fixes: 57bdc4ff4895dd91cc723d22eecadcf48945e87c http://lists.infradead.org/pipermail/libnl/2015-November/002004.html Signed-off-by: Beniamino Galvani <bgalvani@redhat.com> [thaller@redhat.com: add capability to indicate bug-fix] Signed-off-by: Thomas Haller <thaller@redhat.com>
* neigh: add support for NTF_SELFDavid Ahern2015-11-012-6/+15
| | | | | | | | http://lists.infradead.org/pipermail/libnl/2015-October/001995.html Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* route/vrf: add VRF supportDavid Ahern2015-11-018-0/+374
| | | | | | | | http://lists.infradead.org/pipermail/libnl/2015-October/001991.html Signed-off-by: David Ahern <dsa@cumulusnetworks.com> [thaller@redhat.com: slightly modified original patch] Signed-off-by: Thomas Haller <thaller@redhat.com>
* rtnl/link: merge branch 'vlan-protocol-serialize'Thomas Haller2015-10-213-4/+15
|\
| * rtnl/link: indicate capability NL_CAPABILITY_RTNL_LINK_VLAN_PROTOCOL_SERIALZEThomas Haller2015-10-212-1/+7
| | | | | | | | Related: 0aca70083e51d97d0102c73852d31625f75c942b
| * route/link: IFLA_VLAN_PROTOCOL added to vlan_put_attrsskuklinski2015-10-211-0/+3
| | | | | | | | | | | | | | Fixes: 430eb4004ab7f93fd840e9836d4bc9220d3c406d https://github.com/thom311/libnl/issues/90 https://github.com/thom311/libnl/pull/91
| * rtnl/link: document vlan-protocol to be exposed in network-byte orderThomas Haller2015-10-211-3/+5
|/ | | | | | | | | Unfortunately this was done wrong. Instead of fixing it now (and change behavior), document the behavior. Fixes: 430eb4004ab7f93fd840e9836d4bc9220d3c406d Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnl-3.2.27 releaselibnl3_2_27Thomas Haller2015-10-164-3/+9
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* route/link: add missing newlines after debug messagesBeniamino Galvani2015-10-0511-11/+11
| | | | | | | http://lists.infradead.org/pipermail/libnl/2015-October/001977.html Signed-off-by: Beniamino Galvani <bgalvani@redhat.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* lib/attr: add nla utility functions for signed integersThomas Haller2015-10-053-7/+133
| | | | | | | | | | | | | Commit 7bb956501ccd58ed3bbffc59de996f056e178683 added nla functions for s32. We preferibly add all signed integer operations at the same time. Thus, also add s8, s16, and s64. Also, previously the NLA_TYPE_MAX enum was not extended to have NLA_S32. Fix that too. Reported-By: Jiri Pirko <jiri@resnulli.us> Fixes: 7bb956501ccd58ed3bbffc59de996f056e178683 Signed-off-by: Thomas Haller <thaller@redhat.com>
* route: add capability indicating the behavior of rtnl_neigh_get()Thomas Haller2015-09-292-1/+9
| | | | | | | | | | | | | | | A wrong behavior for rtnl_neigh_get() was introduced between 3.2.14 and 3.2.15 (commit 64fcb47a36ec12d7e7f00605f6a8952ce985dd08). It was later fixed between 3.2.21 and 3.2.22 (commit 8571f58f23763d8db7365d02c9b27832ad3d7005). Add a capability NL_CAPABILITY_RTNL_NEIGH_GET_FILTER_AF_UNSPEC_FIX to indicate that this buggy behavior was fixed. https://bugzilla.redhat.com/show_bug.cgi?id=1261028 http://lists.infradead.org/pipermail/libnl/2015-August/001951.html Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnl-3.2.27-rc1 releaselibnl3_2_27rc1Thomas Haller2015-09-212-5/+5
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnl: report an error if unexpected control data was receivedAndrey Vagin2015-09-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we try to handle MSG_CTRUNC, but if msg_controllen is zero, we make double free for the same address. realloc(0, 0) returns non-zero address realloc(addr, 0) returns zero and free(addr) has already been called Then we call free(addr) again and get an error like this: *** Error in `./task_diag_all': double free or corruption (fasttop): 0x0000000000f9c160 *** ======= Backtrace: ========= /lib64/libc.so.6(+0x77e9d)[0x7f360ed96e9d] /lib64/libc.so.6(+0x7f53c)[0x7f360ed9e53c] /lib64/libc.so.6(cfree+0x4c)[0x7f360eda2e9c] /lib64/libnl-3.so.200(nl_recv+0x221)[0x7f360f2f6361] /lib64/libnl-3.so.200(nl_recvmsgs_report+0x555)[0x7f360f2f6a95] /lib64/libnl-3.so.200(nl_recvmsgs+0x9)[0x7f360f2f6d89] ./task_diag_all[0x400f8d] /lib64/libc.so.6(__libc_start_main+0xf0)[0x7f360ed3f790] ./task_diag_all[0x401169] http://lists.infradead.org/pipermail/libnl/2015-September/001965.html Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Thomas Haller <thaller@redhat.com>
* doc: enable generation of Doxygen tagfile for libnl API referenceSteffen Vogel2015-09-192-1/+2
| | | | | | | | | This enables other projects which are using Doxygen for documentation to automatically create hyperlinks to libnl's API reference. See: http://www.stack.nl/~dimitri/doxygen/manual/external.html https://github.com/thom311/libnl/pull/89
* route/link: merge branch 'vlan-flags'Thomas Haller2015-09-032-0/+4
|\ | | | | | | | | | | http://lists.infradead.org/pipermail/libnl/2015-September/001961.html Signed-off-by: Thomas Haller <thaller@redhat.com>
| * vlan: add MVRP VLAN flagJiří Klimeš2015-09-032-0/+2
| | | | | | | | | | | | | | | | Kernel patch: http://patchwork.ozlabs.org/patch/219040/ iproute2 patch: http://patchwork.ozlabs.org/patch/219364/ Signed-off-by: Jiří Klimeš <jklimes@redhat.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
| * vlan: add VLAN flags to trans_tbl to print them properlyJiří Klimeš2015-09-031-0/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | nl-link-list only showed reorder_hdr. $ ip -d link show dev em1.444 28: em1.444@em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default link/ether 3c:97:0e:58:1d:c1 brd ff:ff:ff:ff:ff:ff promiscuity 0 vlan protocol 802.1Q id 444 <REORDER_HDR,GVRP,LOOSE_BINDING> ingress-qos-map { 1:3 4:2 } egress-qos-map { 2:6 9:5 } $ /usr/sbin/nl-link-list --details -i 28 em1.444 ether 3c:97:0e:18:2e:a1 <broadcast,multicast,up,running,lowerup> slave-of em1 group 0 vlan-id 444 mtu 1500 txqlen 0 weight 0 qdisc noqueue index 28 txq 1 rxq 1 brd ff:ff:ff:ff:ff:ff state up mode default carrier up vlan-info id 444 <reorder_hdr,> vlan protocol <129> ingress vlan prio -> qos/socket prio mapping: 1 -> 0x000003, 4 -> 0x000002, egress qos/socket prio -> vlan prio mapping: 0x000002 -> 6, 0x000009 -> 5, ... Signed-off-by: Jiří Klimeš <jklimes@redhat.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* route/link: add missing link_attrs translationsTobias Klauser2015-08-311-0/+3
| | | | | | | | | | | | Add LINK_ATTR_NSFD, LINK_ATTR_NS_PID and LINK_ATTR_LINK_NETNSID to the link_attrs translation table after they were added in commits 760bfabad8cd ("add link netns support") and 66aab65595fb ("route/link: add support for IFLA_LINK_NETNSID") respectively. http://lists.infradead.org/pipermail/libnl/2015-August/001959.html Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* socket: fix assertion in nl_connect() when all ports are already in useThomas Haller2015-08-243-5/+8
| | | | | | | | | | | | | When generating a port fails a few times (because they are already in used outside of libnl's knowledge), we would back off generating a local port and instead let kernel decide. There was however a bug in nl_connect() that caused an assertion: BUG at file position socket.c:147:_nl_socket_used_ports_release_all app: socket.c:147: _nl_socket_used_ports_release_all: Assertion `0' failed. Fixes: 96e1e5bdc2e803700055395cc3c428fa2525d1ca
* route/link: merge support for 'netnsid' (fixes)Thomas Haller2015-08-176-8/+50
|\ | | | | | | | | | | | | | | Fix previous patches to have link_netnsid as signed int32_t. http://lists.infradead.org/pipermail/libnl/2015-August/001941.html Signed-off-by: Thomas Haller <thaller@redhat.com>