summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* link: Fix af_ops leak on ENOMEMThomas Graf2013-02-051-1/+3
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* can: Fix nested message creation in can_put_attrs()Holger Dengler2013-02-011-0/+2
| | | | | | Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de> Signed-off-by: Holger Dengler <dengler@linutronix.de> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* can: Include "linux/can/netlink.h" in the distributionThomas Graf2013-02-011-0/+1
| | | | | | Needed to compile if local kernel headers are outdated. Signed-off-by: Thomas Graf <tgraf@suug.ch>
* neigh: Remove check for AF_UNSPEC in rtnl_neigh_get()Thomas Graf2013-02-011-2/+2
| | | | | | | | | | | | | This check was introduces to not accidently return AF_BRIDGE objects to unaware API users as they do differ in structure. However, such objects are only available if explicitely requests using the NL_CACHE_AF_ITER flag or by using arg1 == AF_BRIDGE for the cache. Therefore remove this check and allow rtnl_neigh_get() to be used to fetch any neighbor object of a cache. Reported-by: Maxime Bizon <mbizon@freebox.fr> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* cache: Make NL_ACT_* and nl_cache_ops_(get|put)() availableThomas Graf2013-02-012-15/+15
| | | | | | | | Move NL_ACT_* definition and the functions nl_cache_ops_get() and nl_cache_ops_put() into the public facing API. They can be considered stable. Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Fix mask calculation in nl_addr_cmp_prefix()Thomas Graf2013-01-311-2/+2
| | | | | Signed-off-by: Malte Langermann <mlangermann@radiodata.biz> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Merge branch 'nattuple' of https://github.com/rmfought/libnlThomas Graf2013-01-311-2/+6
|\
| * netfilter: correct error in construction of NAT tupleRich Fought2013-01-291-2/+6
| |
* | link cache: remove AF_UNSPEC check in rtnl_get_link and rtnl_get_link_by_nameroopa2013-01-311-3/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch reverts back the AF_UNSPEC check introduced by AF_BRIDGE changes at http://lists.infradead.org/pipermail/libnl/2012-November/000796.html After the addition of AF_BRIDGE support, link cache can now contain objects of type AF_BRIDGE. To make sure existing api's did not return AF_BRIDGE objects and surprise existing callers, I introduced the check for AF_UNSPEC. But from what Andy Wang reported, rtnl_link_get_by_name returns the first link object with matching ifindex and that could have not only been AF_UNSPEC but also of family AF_INET6. And his app always got an AF_INET6 object prior to the patch that introduced the AF_UNSPEC check. I could just add AF_INET6 family check along with AF_UNSPEC in the apis and that should work well. But thinking about it some more, removing the AF_UNSPEC change seems to be safer at this point. That way this api will retain its semantics and return the first object with matching ifindex. It could be of any supported family. The user will know if the cache contains bridge objects, because they are available only with the cache flag NL_CACHE_AF_ITER. Besides, if new users want to search for a specific object, nl_cache_find is a better option. Reported-by: Andy Wang <Andy.Wang@watchguard.com> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* can: add helper function to get CAN bus stateBenedikt Spranger2013-01-252-0/+20
| | | | | | Add a helper function to get the CAN bus state. Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
* Merge pull request #29 from rmfought/natdir32Thomas Graf2013-01-242-3/+21
|\ | | | | netfilter: expectation NAT direction is 32 bit attribute
| * netfilter: keep 8-bit API for 32-bit NAT dir attributeRich Fought2013-01-242-4/+4
| |
| * netfilter: expectation NAT direction is 32 bit attributeRich Fought2013-01-234-7/+25
| |
* | 3.2.21 releaselibnl3_2_21Thomas Graf2013-01-242-5/+5
| |
* | Provide better help text when bumping CURRENT,AGE,REVISIONThomas Graf2013-01-241-15/+15
| | | | | | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* | Remove obsolete warning from <netlink/object-api.h> as it breaks NM buildThomas Graf2013-01-241-2/+0
| | | | | | | | | | | | | | NM uses -Werror=cpp thus the build breaks if we emit #warning upon inclusion of <netlink/object-api.h> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* | Fix build warnings of nl-(qdisc|class|cls)-addThomas Graf2013-01-243-0/+6
| | | | | | | | | | Reported-by: Jeroen Roovers <jer@gentoo.org> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* | Fix test-cache-mngr testThomas Graf2013-01-241-0/+2
| | | | | | | | | | | | | | Needs to include <netlink-private/cache-api.h> Reported-by: Jeroen Roovers <jer@gentoo.org> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* | Provide compat headers for removed private APIThomas Graf2013-01-246-1/+109
| | | | | | | | | | | | | | | | | | | | Some projects seem to have mistakenly included the private API headers without actually needing them. Provide dummy headers referring to the real headers to provide backwards compatibility. Signed-off-by: Thomas Graf <tgraf@suug.ch>
* | Move private header files to <netlink-private/*>Thomas Graf2013-01-2497-216/+196
|/ | | | | | | This clarifies the seperation between public and private header files. Signed-off-by: Thomas Graf <tgraf@suug.ch>
* fix includes after removing some headersJiri Pirko2013-01-236-12/+14
| | | | | | | | | | | | | | | commit f20bbe1f07fcff1509425884f5ed72ca8d5fb6ab Author: Thomas Graf <tgraf@suug.ch> Date: Tue Jan 22 19:10:38 2013 +0100 No longer install module API headers This commit causes a regression so no app using libnl can be compiled against it. This patch fixes it by removing includes of no-longe existing headers. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* 3.2.20 releaselibnl3_2_20Thomas Graf2013-01-232-2/+2
|
* route cache: This patch adds route priority to route object oo_id_attrsroopa2013-01-231-2/+7
| | | | | | | | | | | | | | | | | The kernel allows multiple entries in the main table which differ in the priority value. In libnl currently, since priority is not part of the base netlink route message, it is not used as part of the key. This patch includes priority in the key/oo_id_attrs and defaults the value to zero for messages where priority is not included. One point to note is that the actual selection of route from multiple options is done implicitly in the kernel by storing the routes in sort priority order, but there is no explicit communication to a client of libnl of that. Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Remove obsolete release notes at end of configureThomas Graf2013-01-231-4/+1
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* No longer install module API headersThomas Graf2013-01-231-6/+6
| | | | | | | | | | | | | | | Various header files providing an API to implement own cache and object types or implement link types have been available in the past. Their API is marked unstable in the documentation and nobody is using them so far. Technically they have been causing ABI breakages in at least two 3.2.x releases. In order to avoid future accidental breakage, no longer install these and require module developers to clone the git tree and build modules off the git tree directly to make sure that the API is unstable at this point. Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Undo soname bumpThomas Graf2013-01-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The soname was bumped before 3.2.18 was released to reflect an ABI change in the cache and object API. This caused a discussion with various distribution maintainers involved as it prevented them from including the release in their stable branches. This is especially unfortunate as the corresponding API is unused outside of libnl as of now. For this reason, I have decided to undo the soname bump and instead remove the corresponding header files from the list of installable headers and thus remove them from the public API. This is a API break technically but since nobody is using them it should not matter. If you are in fact using any of the *-api.h headers please let me know and we are most likely to start a new development branch. If your application linked against 3.2.18 or 3.2.19 you will need to relink if you want it to use >= 3.2.20. Signed-off-by: Thomas Graf <tgraf@suug.ch>
* link: fix reference leak in rtnl_link_af_data_compare()Thomas Graf2013-01-181-5/+10
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* link: Add af data compare to link objectsroopa2013-01-181-2/+20
| | | | | | | | | | | | | | | | | | | | | | Today the link compare function does not compare af data of a link. We have found a need for this to get approriate change callbacks when af_data of a link changes. This patch adds support to compare af_data to link_compare function. This patch today only adds support to compare af_data set by PROTINFO attributes. It can be extended to support compares of af_data set by AF_SPEC attributes It has been tested for AF_BRIDGE objects. In case of AF_BRIDGE objects, this helps with bridge port change notification callbacks. Signed-off-by: Wilson Kok <wkok@cumulusnetworks.com> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Add new rtnl_link_af_data_compare function to compare af_dataroopa2013-01-182-0/+35
| | | | | | | | This patch adds a new api rtnl_linl_af_data_compare to compare link af_data Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* 3.2.19 releaselibnl3_2_19Thomas Graf2013-01-172-5/+5
|
* Add ao_compare support to bridge family af_dataroopa2013-01-121-1/+21
| | | | | | | | | | | | | This patch adds support for ao_compare operation to bridge link af data operations. Adds field ce_mask to struct bridge_data to work with the ATTR attributes. I can submit separate patches to introduce mask field to ATTR macros. Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: Wilson Kok <wkok@cumulusnetworks.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* link af ops: Add new ao_compare op to compare link af_dataroopa2013-01-121-0/+13
| | | | | | | | | | | | | | This patch adds new operation to compare link af_data. ao_compare is similar to object oo_compare operation. This op can be used when two links are compared for their af data. It takes two link objects in question, an object specific bitmask defining which attributes should be compared and flags to control the behaviour. The function must return a bitmask with the relevant bit set for each attribute that mismatches. Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* cache: Add new nl_cache_find apiroopa2013-01-113-0/+62
| | | | | | | | | | | | | | | | | This patch adds new cache find api nl_cache_find api was suggested by Thomas. Unlike nl_cache_search, this patch uses nl_object_match_filter() to look for an object match. Am not sure this matches what was decided on the list few weeks back. I will be happy to make any changes. Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* link: add carrier supportFlavio Leitner2013-01-115-1/+73
| | | | | Signed-off-by: Flavio Leitner <fbl@redhat.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* 3.2.18 releaselibnl3_2_18Thomas Graf2013-01-082-4/+4
|
* fix include/Makefile.amThomas Graf2013-01-081-2/+3
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* build: Fix distribution to include 'nfnetlink_conntrack.h'Otavio Salvador2013-01-081-1/+2
| | | | | | | | The header has not been included in the headers list so it has been been distributed in the tarball making it fail to build in old kernels. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* cache: make sure the user has specified a callbackmihai.dontu@gmail.com2013-01-061-1/+2
| | | | | | | | | | In cache_include(), the user callback is used even though one might not have been specified, leading to a crash. This happens, for example, when NetworkManager calls nl_cache_include() with the change_cb argument set to NULL. Fix it by making sure the callback points to a valid address. Signed-off-by: Mihai Dontu <mihai.dontu@gmail.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Add <netlink/route/link/can.h> to dist targetThomas Graf2013-01-041-0/+1
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* 3.2.17 releaselibnl3_2_17Thomas Graf2013-01-042-5/+5
|
* nlmsg_ok comparison between signed and unsignedEric Paris2013-01-031-1/+1
| | | | | | | | | | | | | | | | | The nlmsg_ok macro has a comparison between an int and a size_t (unsigned int). The C spec says the int is cast to unsigned int before the comparison. This is a problem as the audit system will send skb's with skb->len == nlhhdr->nlmsg_len which are NOT aligned. Thus you can end up with remaining being negative. So the comparison becomes (unsigned int)(-1) >= (unsigned int)16 Which turns out to be true! It should clearly be false. So if we cast the size_t to an int we get a signed comparison and it works. (This is what linux/netlink.h and all of the kernel netlink headers do) Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Fix file descriptor leak on errorThomas Jarosch2012-12-271-4/+12
| | | | | | | Detected by cppcheck Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* cache: Take cache_ops lock when modifying cache ops flagsThomas Graf2012-12-271-0/+2
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* cache pickup: Avoid duplicates during cache pickuproopa2012-12-211-3/+23
| | | | | | | | | | | | | | This patch adds search and replace/update functionality to cache pickup_cb. This change is required to avoid duplicates getting into the cache during pickup. Also helps updating existing objects during cache pickup. We have seen this in cases of ipv6 equal cost multipath routes changes v1 to v2: - Updated documentation Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
* make: automake provides a cscope target these daysThomas Graf2012-12-211-4/+0
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Bug Fix: cache_include: Fix object ref release after successful object updateroopa2012-12-171-1/+1
| | | | | | | | The current code does a rtnl_link_put on new object instead of old object. This patch fixes it. None of the caches have support for object update, so this should not have affected anyone yet. Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
* route cache: Fix handling of ipv6 multipath routesroopa2012-12-171-0/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two ways kernel handles ipv6 equal cost multipath routes depending on which kernel version you are looking at. older kernels without ipv6 ECMP support, accept the below ECMP routes, #ip -6 route add 2001::/16 nexthop via fe80:2::2 dev swp1 #ip -6 route add 2001::/16 nexthop via fe80:2::3 dev swp1 store them as separate routes and pick the last one during lookup. Newer kernels, after the support for equal cost multipath routes was added http://patchwork.ozlabs.org/patch/188562/, now accept multipath routes added individually using the above 'ip -6 route' format OR sent using RTA_MULTIPATH with the below command #ip -6 route add 2001::/16 nexthop via fe80:2::2 dev swp1 nexthop via fe80:2::3 dev swp1 And the kernel now stores and treats them as equal cost multipath routes during lookups. However in all cases above, netlink notifications to ipv6 ECMP route adds and deletes come separately for each next hop. Example libnl notification in the above case with both old and new kernels: inet6 2001::/16 table main type unicast scope global priority 0x400 protocol boot nexthop via fe80:2::2 dev swp1 inet6 2001::/16 table main type unicast scope global priority 0x400 protocol boot nexthop via fe80:2::3 dev swp1 Since they are separate route notifications for objects with same key, libnl replaces the existing ones and hence only the last route update sticks. This patch uses the oo_update feature to not replace but update an existing route if its a ipv6 equal cost multipath route. The object after an update looks like the below (similar to ipv4 ECMP routes): inet6 2001::/16 table main type unicast scope global priority 0x400 protocol boot nexthop via fe80:2::2 dev swp1 nexthop via fe80:2::3 dev swp1 Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Reviewed-by: Nolan Leake <nolan@cumulusnetworks.com> Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Merge branch 'aligned_be64' of https://github.com/rmfought/libnlThomas Graf2012-12-172-0/+8
|\
| * Re-adding #defines for __aligned_be64 for older kernelsRich Fought2012-12-132-0/+8
| |
* | Included defs.h so DISABLE_PTHREADS is visible.Rich Fought2012-12-131-0/+2
|/