History log of /external/iproute2/lib/libnetlink.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
57fdf2d4d94aeee493214d455b8f3336f09afa09 08-Jan-2016 Lorenzo Colitti <lorenzo@google.com> libnetlink: don't print NETLINK_SOCK_DIAG errors in rtnl_talk

This change is a no-op, as currently no code uses rtnl_talk on
NETLINK_SOCK_DIAG_BY_FAMILY sockets. It is needed to suppress
spurious errors when using SOCK_DESTROY via rtnl_talk.

Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
/external/iproute2/lib/libnetlink.c
ed108cfc0260b6b751647982b77d6363b1defb15 03-Dec-2015 Nicolas Dichtel <nicolas.dichtel@6wind.com> libnetlink: don't confuse variables in rtnl_talk()

There is two variables named 'len' in rtnl_talk. In fact, commit
c079e121a73a didn't work. For example, it was possible to trigger
a seg fault with this command:
$ ip link set gre2 type ip6gre hoplimit 32

Let's rename the argument len to maxlen.

Fixes: c079e121a73a ("libnetlink: add size argument to rtnl_talk")
Reported-by: Thomas Faivre <thomas.faivre@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
/external/iproute2/lib/libnetlink.c
8e72880f6bfa39f439b9c4a88eb84b635b991687 24-Nov-2015 Phil Sutter <phil@nwl.cc> libnetlink: introduce nc_flags

Allow for a filter to ignore certain nlmsg_flags.

Signed-off-by: Phil Sutter <phil@nwl.cc>
/external/iproute2/lib/libnetlink.c
c6646c1ea56c3198c19643b2f60e79fec3b07244 17-Oct-2015 Stephen Hemminger <shemming@brocade.com> Merge branch 'master' into net-next
303cc9cbeed6cfb9f08a4073f07cb466cc8098e8 15-Oct-2015 Roopa Prabhu <roopa@cumulusnetworks.com> libnetlink: introduce rta_nest and u8, u16, u64 helpers for nesting within rtattr

This patch introduces two new api's rta_nest and rta_nest_end to
nest attributes inside a rta attribute represented by 'struct rtattr'
as required to construct a nexthop. Also adds rta_addattr* variants
for u8, u16 and u64 as needed to support encapsulation.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Acked-by: Jiri Benc <jbenc@redhat.com>
/external/iproute2/lib/libnetlink.c
0d238ca2b8b79e31dbbae78875f4293e4f04de11 02-Oct-2015 David Ahern <dsa@cumulusnetworks.com> ip neigh: Add support for filtering dumps by master device

Add support for filtering neighbor dumps by master device. Kernel side
support provided by commit 21fdd092acc7. Since the feature is not
available in older kernels the user is given a warning message if the
kernel does not support the request.

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
/external/iproute2/lib/libnetlink.c
03371c7d98d167145b0c562f5d2ca2f54c8a5c7f 28-May-2015 Stephen Hemminger <shemming@brocade.com> Merge branch 'master' into net-next

Conflicts:
include/linux/tcp.h
lib/libnetlink.c
c079e121a73af5eb49e003b13607e8a690331df6 27-May-2015 Stephen Hemminger <shemming@brocade.com> libnetlink: add size argument to rtnl_talk

There have been several instances where response from kernel
has overrun the stack buffer from the caller. Avoid future problems
by passing a size argument.

Also drop the unused peer and group arguments to rtnl_talk.
/external/iproute2/lib/libnetlink.c
449b824ad19679f66164e1e97513f36eee0d004e 20-May-2015 Nicolas Dichtel <nicolas.dichtel@6wind.com> ipmonitor: allows to monitor in several netns

With this patch, it's now possible to listen in all netns that have an nsid
assigned into the netns where the socket is opened.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
/external/iproute2/lib/libnetlink.c
0628cddd9d5c0cb9ed0e0aba136e50de93487150 20-May-2015 Nicolas Dichtel <nicolas.dichtel@6wind.com> libnetlink: introduce rtnl_listen_filter_t

There is no functional change with this commit. It only prepares the next one.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
/external/iproute2/lib/libnetlink.c
decbb4378c5fc40a5842a8e67bc218305accb454 06-Jan-2015 Jiri Pirko <jiri@resnulli.us> libnetlink: add parse_rtattr_one_nested helper

Sometimes, it is more convenient to get only one specific nested attribute by
type. For example for IFLA_AF_SPEC where type is address family (AF_INET6).
So add this helper for this purpose.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
/external/iproute2/lib/libnetlink.c
486ccd99a0b4f4d2c58546264280f1a884aa0c10 26-Dec-2014 Vadim Kochan <vadim4j@gmail.com> ss: Use rtnl_dump_filter for inet_show_netlink

Just another refactoring for ss to use rtnl API from lib

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/lib/libnetlink.c
8a4025f6a4e182f0f33763238314ff1d96c580db 03-Dec-2014 vadimk <vadim4j@gmail.com> ss: Use rtnl_dump_filter in handle_netlink_request

Replaced handling netlink messages by rtnl_dump_filter
from lib/libnetlink.c, also:

- removed unused dump_fp arg;
- added MAGIC_SEQ #define for 123456 seq id;
- silently exit if ENOENT errno is caused for NETLINK_SOCK_DIAG proto
in lib/libnetlink.c: rtnl_duml_filter_l(...) function. This fix
was added in a3fd8e58c1787af186f5c4b234ff974544f840b6 by Eric
for misc/ss.c

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/lib/libnetlink.c
e557212edafa069eea27022c9331fd30b9fac067 11-Oct-2014 Eric Dumazet <edumazet@google.com> netlink: extend buffers to 16K

Starting from linux-3.15 (commit 9063e21fb026, "netlink: autosize skb
lengths"), kernel is able to send up to 16K in netlink replies.

This change enables iproute2 commands to get bigger chunks,
without breaking compatibility with old kernels.

Signed-off-by: Eric Dumazet <edumazet@google.com>
/external/iproute2/lib/libnetlink.c
bcb9d403196944d12b7ec095d66a805ea786fd2e 03-Jun-2013 Andrey Vagin <avagin@openvz.org> ip: set the close-on-exec flag for descriptors

Otherwise a program executed by "ip netns exec" has two extra
descriptors.

$ ip netns exec test /bin/bash
$ lsof -p $$
...
bash 817 root 0u CHR 136,0 0t0 3 /dev/pts/0
bash 817 root 1u CHR 136,0 0t0 3 /dev/pts/0
bash 817 root 2u CHR 136,0 0t0 3 /dev/pts/0
bash 817 root 3u sock 0,6 0t0 13386 protocol: NETLINK
bash 817 root 4r REG 0,3 0 4026532155 net
bash 817 root 255u CHR 136,0 0t0 3 /dev/pts/0

Cc: Stephen Hemminger <stephen@networkplumber.org>
Reported-by: Dilip Daya <dilip.daya@hp.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
/external/iproute2/lib/libnetlink.c
63338dca45135c85c7f588bd5068e6e77ff816eb 25-Apr-2013 Alexander Duyck <alexander.h.duyck@intel.com> libnetlink: Use ifinfomsg instead of rtgenmsg in rtnl_wilddump_req_filter

This change corrects a kernel incompatibility that was resulting in the
ext_filter_mask not being correctly discovered by the kernel as it is buried
somewhere in the ifinfomsg.

Reported-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Acked-by: David S. Miller <davem@davemloft.net>
/external/iproute2/lib/libnetlink.c
16f02e145e3185d36aa2d8036975f0599d29bc76 22-Mar-2013 Nicolas Dichtel <nicolas.dichtel@6wind.com> libnetlink: check flag NLM_F_DUMP_INTR during dumps

When this flag is set, it means that dump was interrupted and result may be
inconsistent.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
/external/iproute2/lib/libnetlink.c
b1b7ce0f0d2c53bf3993ec6b455e4c12ad84dcde 15-Mar-2013 Vlad Yasevich <vyasevic@redhat.com> bridge: Add support for printing bridge port attributes

Output new nested bridge port attributes.

Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
/external/iproute2/lib/libnetlink.c
9eff0e5cc44770137fd0e383f80d0eaab948a03c 28-Feb-2013 Vlad Yasevich <vyasevic@redhat.com> bridge: Add vlan configuration support

Recent kernel patches added support for VLAN filtering on the bridge.
This functionality allows one to turn a basic bridge into a VLAN bridge,
where VLANs dicatate packet forwarding and header transformation.

To configure the VLANs on the bridge and its ports a new command is
added to the 'bridge' utility.

# bridge vlan add dev eth0 vid 10 pvid untagged brdev
# bridge vlan add
# bridge vlan delete dev eth0 vid 10
# bridge vlan show

This command supports the following flags:
master - peform the operation on the software bridge device. This is
the default behavior.
self - perform the operation on the hardware associated with the port.
This flag is required when the device is the bridge device and
the configuration is desired on the bridge device itself (not
one of the ports).
pvid - Set the PVID (port vlan id) for a given port. Any untagged
frames arriving on the port will be assigned to this vlan.
untagged - Sets the egress policy of for a given vlan. Default port
egress policy is tagged. Set this flag if you wish traffic
associated with this VLAN to exit the port untagged.

Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
/external/iproute2/lib/libnetlink.c
257422f77fc2a11429a3f86dea0a740752d15d19 30-Aug-2012 Lutz Jaenicke <ljaenicke@innominate.com> rtnl_wilddump_request: fix alignment issue for embedded platforms

Platforms have different alignment requirements which need to be
fulfilled by the compiler. If the structure elements are already
4 byte (NLMGS_ALIGNTO) aligned by the compiler adding an explicit
padding element (align_rta) is not allowed.
Use __attribute__ ((aligned (NLMSG_ALIGNTO))) in order to achieve
the required alignment.
Experienced on ARM (xscale) with symptom
netlink: 12 bytes leftover after parsing attributes

Tested on:
ARM (32bit Big Endian)
PowerPC (32bit Big Endian)
x86_64 (64bit Little Endian)
Each with different aligment requirments.

Signed-off-by: Lutz Jaenicke <ljaenicke@innominate.com>
/external/iproute2/lib/libnetlink.c
b8cf1e9ae3d5e5ec17e79c0876755594770952b7 19-Aug-2012 Pavel Emelyanov <xemul@parallels.com> iproute: Fix errno propagation from rtnl_talk

Callers of rtnl_talk check errno value for their needs. In particular, the addrs
and routes restoring code validly reports success if the EEXISTS is in there.

However, the errno value can be sometimes screwed up by the perror call. Thus
we should only set it _after_ the message was emitted.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
/external/iproute2/lib/libnetlink.c
bd886ebb1ffd84301caa2341b671df9a9e2db4c9 21-Feb-2012 Rose, Gregory V <gregory.v.rose@intel.com> iproute2: Add netlink attribute to filter dump requests

Add a new netlink attribute type to the dump request to allow
filtering of the information returned for the respective matching
interfaces. At this time the only filter defined is to request
virtual function (VF) device info for interfaces that attached VFs.

It will also be possible to extend the request with other yet to be
defined netlink attributes in the future.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
/external/iproute2/lib/libnetlink.c
aa38c3eefaf6c6f4fd0a8858f6b771b6c8f84129 19-Jan-2012 Masatake YAMATO <yamato@redhat.com> using NLM_F_DUMP flag constant in libnetlink.c

This is trivial patch for libnetlink.c in iproute2.

In iproute2/include/linux/netlink.h NLM_F_DUMP is defines as:

#define NLM_F_DUMP (NLM_F_ROOT|NLM_F_MATCH)

It is not used in libnetlink.c. If used, the code becomes a bit easier
to read.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
/external/iproute2/lib/libnetlink.c
cd70f3f522e04b4d2fa80ae10292379bf223a53b 28-Dec-2011 Stephen Hemminger <shemminger@vyatta.com> libnetlink: remove unused junk callback

Both rtnl_talk and rtnl_dump had a callback for handling portions
of netlink message that do not match the correct pid or seq.
But this callback was never used by any part of iproute2 so remove
it.
/external/iproute2/lib/libnetlink.c
2aa3dd29a75c494bf969586da5489d4dc7d07839 23-Dec-2011 Stephen Hemminger <shemminger@vyatta.com> libnetlink: add more attribute functions

New functions to handle u8, u16, u32, u64 and string attribute types.
Use common code for all attribute wrappers.
/external/iproute2/lib/libnetlink.c
6cf8398f5f487762586801c25539d8fe5bb33b39 23-Dec-2011 Stephen Hemminger <shemminger@vyatta.com> libnetlink: change rtnl_send() to take void *

Avoid having to cast buffer being sent.
/external/iproute2/lib/libnetlink.c
2dd9f8e073717aed2b624d1e9e325487260b57eb 20-Jun-2011 Stephen Hemminger <shemminger@vyatta.com> libnetlink: fix set never used warning
/external/iproute2/lib/libnetlink.c
3bc1c4f29777171b484d36abf673667e3729202b 16-Aug-2010 Ben Greear <greearb@candelatech.com> iproute2: Fix filtering related to flushing IP addresses.

The old 'ip addr flush' logic had several flaws:

* It reversed logic for primary v/s secondary flags
(though, it sort of worked right anyway)

* The code tried to remove secondaries and then primaries,
but in practice, it always removed one primary per loop,
which not at all efficient.

* The filter logic in the core would run only the first
filter in most cases.

* If you used '-s -s', the ifa_flags member would be
modified, which could make future filters fail
to function fine.

This patch attempts to fix all of these issues.

Tested-by: Brian Haley <brian.haley@hp.com>
Signed-off-by: Ben Greear <greearb@candelatech.com>
/external/iproute2/lib/libnetlink.c
6e46ec813b7f06a85acb5a348dfc1a25ea488024 10-Feb-2010 Williams, Mitch A <mitch.a.williams@intel.com> libnetlink: Modify the parser to track first duplicated attributes

Modify the parser to keep track of the first of any duplicated attributes,
instead of the last. This is required for VF configuration reporting, where
multiple attributes of the same type are added sequentially.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
/external/iproute2/lib/libnetlink.c
b49240ec7eab91418d2f090536bf8cd2205988d6 02-Dec-2009 Simon Horman <horms@verge.net.au> flush secondary addresses before primary ones

Unless promote_secondaries has been active deleting the primary address of
an interface will automatically delete all the secondary addresses.

In the case where ip flush requests the primary then secondary addresses to
be removed - which is the order the addresses are returned by the kernel -
this will cause an error as by the time the request to remove a secondary
address is made it will be missing as it will have been deleted in the
course of deleting the primary address.

This approach to solving this problem orders requests for the
deletion of secondary addresses before primary ones providing
rtnl_dump_filter_l(), a version of rtnl_dump_filter() that
iterates over a list of filters. And by providing two specialised
filters print_addrinfo_secondary() and print_addrinfo_primary().

rtnl_dump_filter_l() first iterates over all addresses using
print_addrinfo_secondary(), which appends secondary addresses to the
request buffer. Then again using print_addrinfo_primary() which appends
primary addresses.

This approach should work regardless of it promote_secondaries is
active or not. And regardless of if any primary of secondary addresses
are present or not.

Signed-off-by: Simon Horman <horms@verge.net.au>
/external/iproute2/lib/libnetlink.c
7f03191fda39ff09640f093b7ad84f461ffd65b2 28-Oct-2009 Patrick McHardy <kaber@trash.net> iproute uses too small of a receive buffer

It uses 1MB as receive buf limit by default (without
increasing /proc/sys/net/core/rmem_max it will be limited by less
however) and allows to specify the size manually using "-rcvbuf X"
(-r is already used, so you need to specify at least -rc).

Additionally rtnl_listen() continues on ENOBUFS after printing the
error message.
/external/iproute2/lib/libnetlink.c
24f38182441868f27aec03e82105eb008127e879 10-Nov-2009 Sven Anders <anders@anduras.de> Fix flushing code - rtnl_send_check

I experienced an error, if I try to perform a

ip route flush proto 4

with many routes in a complex environment, it
gave me the following error:

Failed to send flush request: Success
Flush terminated
/external/iproute2/lib/libnetlink.c
2d8240f8d95dfdc276dcf447623129fb5ccedcd6 13-Jul-2009 Stephen Hemminger <stephen.hemminger@vyatta.com> Fix flushing of large number of entries

Checking for errors would cause some responses to be lost.
/external/iproute2/lib/libnetlink.c
f31a37f79d1f33d4d0d6a18f3768bfee27e8b6cc 01-Feb-2008 Stephen Hemminger <stephen.hemminger@vyatta.com> fix problem caused by rtnl_send checks

Some usages of rtnl_send could cause errors (ie flush requests)
others do a listen afterwards.

Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
/external/iproute2/lib/libnetlink.c
54bb35c69cec6c730a4ac95530a1d2ca6670f73b 26-Jan-2008 Stephen Hemminger <stephen.hemminger@vyatta.com> poll for errors after rtnl_send

This fixes the problem where a bulk operation (like ip flush)
is performed as non-root user. The kernel will only send a response
if there is an error, so check for it.
/external/iproute2/lib/libnetlink.c
aa8032e628405c1318271fc928babbc06ab12d62 26-Jan-2008 Stephen Hemminger <stephen.hemminger@vyatta.com> libnetlink: don't spin forever on receive error

If there is a problem talking to kernel, don't retry except in the
special case of signal or -EAGAIN

Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
/external/iproute2/lib/libnetlink.c
037c635eee994f6b29fc82931490e831d4a2ead2 10-Dec-2007 Stephen Hemminger <shemminger@linux-foundation.org> Fix off by one in nested attribute management.

Fixes segv in:
tc qdisc show dev eth1
due to uninitialized attribute table.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
/external/iproute2/lib/libnetlink.c
2f90c9c0bb0d8ed4841cb4c77c2d707ec07f20bf 14-Aug-2007 Patrick McHardy <kaber@trash.net> IPROUTE2: RTNETLINK nested attributes

This adds capability for iproute2 to send nested attributes to the
kernel, while maintaining backwards compatibility.

Signed-off-by: Patrick McHardy <kaber@trash.net>
/external/iproute2/lib/libnetlink.c
b16621cafd599499fdbaa79236266d72a53106bb 11-May-2007 Stephen Hemminger <shemminger@linux-foundation.org> incorrect initialization

Fix initialization in libnetlink.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
/external/iproute2/lib/libnetlink.c
3bfa73ff99291d872f6d0e0284ee416e880088b6 26-Sep-2006 Stephen Hemminger <shemminger@osdl.org> rtnl fd check

Prevent accidental damage from rtnl library if fd is uninitialized.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
/external/iproute2/lib/libnetlink.c
4cca16f20e92a97399d5814fc810af66ce0581d8 11-Mar-2006 shemminger <shemminger> Fix endless loop in netlink error handling.
/external/iproute2/lib/libnetlink.c
fb2297599de1fb7447a050e16e0179f739460473 05-Oct-2005 shemminger <shemminger> When assigning an ip address to an ethernet adapter, the newest
(050929) version of 'ip addr' hangs while older versions worked.
The problem was traced to be a removed initialisation. The patch
below corrects this problem.
/external/iproute2/lib/libnetlink.c
8ed63ab1f1283b2c63355fb7c1e80abead4b9399 21-Sep-2005 shemminger <shemminger> Fix leaks and warnings reported by valgrind.
/external/iproute2/lib/libnetlink.c
f332d169246447bd5e258ac03d5ee840a70adb1e 06-Jul-2005 shemminger <shemminger> Cleanup GCC4 warnings about signedness.
/external/iproute2/lib/libnetlink.c
3dabdbb3da5ab7e9df8bf561602d681db26d8982 30-Mar-2005 net[shemminger]!shemminger <net[shemminger]!shemminger> Import patch netlink-align

(Logical change 1.179)
/external/iproute2/lib/libnetlink.c
175e2440df5be09b0a4c134cad958a49f7bfb9d9 07-Feb-2005 osdl.net!shemminger <osdl.net!shemminger> gcc 2.95 compile fix.

(Logical change 1.138)
/external/iproute2/lib/libnetlink.c
07f9436201eba2f75e6c480f5b16316b3bf977fc 18-Jan-2005 6!tgraf <6!tgraf> Use NLMSG_TAIL and add addraw_l

(Logical change 1.128)
/external/iproute2/lib/libnetlink.c
6dc9f016347441fbf94cf851c054b0f45ba32c1c 31-Aug-2004 osdl.net!shemminger <osdl.net!shemminger> make all filtering handles take const args.

(Logical change 1.77)
/external/iproute2/lib/libnetlink.c
007d3a3e9f0747039a772198293fd7f45a025f80 14-Aug-2004 osdl.net!shemminger <osdl.net!shemminger> Bigger send/receive buf.

(Logical change 1.66)
/external/iproute2/lib/libnetlink.c
c7699875bee00fbcd057fc62c30d6560b044e007 07-Jul-2004 net[shemminger]!shemminger <net[shemminger]!shemminger> Import patch ipxfrm-20040707_2.diff

(Logical change 1.53)
/external/iproute2/lib/libnetlink.c
10f57ef1ab9b4fca639cb2383bc04616fafba5ef 08-Jun-2004 org[shemminger]!shemminger <org[shemminger]!shemminger> Import patch iproute2-2.4.7-netlink.patch

(Logical change 1.9)
/external/iproute2/lib/libnetlink.c
aba5acdfdb347d2c21fc67d613d83d4430ca3937 15-Apr-2004 osdl.org!shemminger <osdl.org!shemminger> (Logical change 1.3)
/external/iproute2/lib/libnetlink.c
86fdf0e47be697587efcf9602cd1f952a1d73170 15-Apr-2004 osdl.org!shemminger <osdl.org!shemminger> Initial revision
/external/iproute2/lib/libnetlink.c