History log of /system/core/libsysutils/src/NetlinkEvent.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
d7ff7ea65220718398cae1e1aa0005072229b4e7 11-Jun-2014 Lorenzo Colitti <lorenzo@google.com> Support parsing netlink route messages.

Bug: 9180552
Change-Id: I4a36d869ac692647fb226d0912285bdf2ffcb1fa
/system/core/libsysutils/src/NetlinkEvent.cpp
9b34293566833ead1d7bac7518e5ccad0d92d61c 19-Jun-2014 Lorenzo Colitti <lorenzo@google.com> Improvements to netlink event parsing.

1. Accept that parseNetlinkMessage can only parse one netlink
message, because its way of returning output is to modify its
member variables (mAction, mParams, etc.). Currently, it
loops through all the messages it finds, updating its member
variables as it goes along, and always returns true at the end
of the buffer. This has the following problems:

1. Since the function always returns true even when no
messages were parsed, the caller has no way to know if
parsing succeeded, and we get lots of "No subsystem found
in netlink event" logs if the buffer did not contain any
valid messages we were interested in.
2. If there are multiple messages in the buffer, all but the
last message will be silently ignored.
3. If there are multiple messages and previous messages have
more parameters than the last one, the resulting event will
have a mixture of parameters from multiple messages.

Instead of doing all this, change the contract to "parse the
first valid message of interest in the buffer and return true,
or return false if there were no such messages", and update
the code and the comments accordingly.

2. Modify the caller (NetlinkListener) so it doesn't log an
error when parseBinaryNetlinkMessage returns false, because
this can now simply mean that we weren't interested in that
particular message. parseBinaryNetlinkMessage already logs
more informative errors.

3. Provide utility functions to check received message lengths and
to convert message types to message names.

4. Simplify logging duplicate attributes.

5. Use the appropriate IFLA_xxx macros instead of rolling our own
code to parse link state messages.

6. Move all the parsing code out to per-message-type parsing
functions to order to simplify parseBinaryNetlinkMessage.

Bug: 9180552
Change-Id: I6bbc2f7a104f618674dde2369c1fd5e93ea49430
/system/core/libsysutils/src/NetlinkEvent.cpp
80f63d4b2c45bd609cbda78bcd016baf0138a5d3 01-May-2014 Mark Salyzyn <salyzyn@google.com> libsysutil: turn on -Werror (part deux)

- x86_64 format warnings

Change-Id: I81c2702f564bcada946f6a10f34bbf34c90f766b
/system/core/libsysutils/src/NetlinkEvent.cpp
9418fd1821d5f31e6004a6f70cb14f59735dc589 29-Apr-2014 Mark Salyzyn <salyzyn@google.com> libsysutils: turn on -Werror

- Deal with some -Wunused / -Wunused-variable issues

Change-Id: I428a0032a8743c68c97f528d5f305ba63fee1d29
/system/core/libsysutils/src/NetlinkEvent.cpp
66ed50af6870210ce013a5588a688434a5d48ee9 22-Nov-2013 The Android Open Source Project <initial-contribution@android.com> Merge commit '536dea9d61a032e64bbe584a97463c6638ead009' into HEAD

Change-Id: I5c469a4b738629d99d721cad7ded02d6c35f56d5
c7eec83f08329a2a0008ba939c07dd1dc7d9b7ff 12-Aug-2013 Lorenzo Colitti <lorenzo@google.com> Support parsing RDNSS ND options from netlink.

The RDNSS options (RFC 6106) used to configure DNS servers via
router advertisements are passed from the kernel to userspace via
RTM_NEWNDUSEROPT netlink messages. Add code to NetlinkEvent to
parse them.

Also fix a compiler warning and a couple of style issues.

[Cherry-pick of b185e90dcc6ac111bff908edcc6d89fd6b37dc11]

Bug: 9180552
Change-Id: I6c532c8f0ceef3afdc977a431a036df398013e1a
/system/core/libsysutils/src/NetlinkEvent.cpp
526b838c9d647e8767fac957c53133153c3cf909 02-Sep-2013 Lorenzo Colitti <lorenzo@google.com> Switch back to subsystem "net" for netlink events.

The change to enable address tracking via netlink incorrectly
changed the subsystem of rtnetlink events from "net" to
"interface". This broke interface add/delete notifications,
which come from the kernel with subsystem "net".

Switch back to "net" and deal with address tracking via new
action codes instead of a new subsystem.

[Cherry-pick of f34861346d5c207912075fba9874090e4c947869]

Bug: 10433320
Change-Id: Ibf30efb426949dfd02304cc1d9adb1c005a539a6
/system/core/libsysutils/src/NetlinkEvent.cpp
96834569343f38dc006492fccdf6dad68521b005 16-Aug-2013 Lorenzo Colitti <lorenzo@google.com> Get rid of an infinite loop in NetlinkEvent.cpp.

[Cherry-pick of 3984276ce47c965ad02a522280a139e0a0c7e5cf]

Bug: 10358527
Bug: 10263310
Bug: 10232006
Change-Id: I750e4bdf2000040adf214d6a772591d7bd25b350
/system/core/libsysutils/src/NetlinkEvent.cpp
381f70f52a282e6da780e4b686aaa9c230be2cdc 01-Aug-2013 Lorenzo Colitti <lorenzo@google.com> Parse IP address changes in NetlinkEvent.

This adds support for parsing RTM_NEWADDR and RTM_DELADDR
netlink messages received on netd's netlink socket and
formatting them them so NetlinkHandler can process them.

Address changes are notified in subsystem "address". Interface
changes, which used to be notified in subsystem "net", are now
notified in subsystem "interface" to avoid confusion.

[Cherry-pick of a4b4e9ad8e35ab424e61d76ebe6654445fc61e63]

Bug: 10232006
Change-Id: I93a50e8de17014e118a42f5cc0eb90a0cbfa73cc
/system/core/libsysutils/src/NetlinkEvent.cpp
f34861346d5c207912075fba9874090e4c947869 02-Sep-2013 Lorenzo Colitti <lorenzo@google.com> Switch back to subsystem "net" for netlink events.

The change to enable address tracking via netlink incorrectly
changed the subsystem of rtnetlink events from "net" to
"interface". This broke interface add/delete notifications,
which come from the kernel with subsystem "net".

Switch back to "net" and deal with address tracking via new
action codes instead of a new subsystem.

Bug: 10433320
Change-Id: Ibf30efb426949dfd02304cc1d9adb1c005a539a6
/system/core/libsysutils/src/NetlinkEvent.cpp
3984276ce47c965ad02a522280a139e0a0c7e5cf 16-Aug-2013 Lorenzo Colitti <lorenzo@google.com> Get rid of an infinite loop in NetlinkEvent.cpp.

Bug: 10358527
Bug: 10263310
Bug: 10232006
Change-Id: I750e4bdf2000040adf214d6a772591d7bd25b350
/system/core/libsysutils/src/NetlinkEvent.cpp
a4b4e9ad8e35ab424e61d76ebe6654445fc61e63 01-Aug-2013 Lorenzo Colitti <lorenzo@google.com> Parse IP address changes in NetlinkEvent.

This adds support for parsing RTM_NEWADDR and RTM_DELADDR
netlink messages received on netd's netlink socket and
formatting them them so NetlinkHandler can process them.

Address changes are notified in subsystem "address". Interface
changes, which used to be notified in subsystem "net", are now
notified in subsystem "interface" to avoid confusion.

Bug: 10232006
Change-Id: I93a50e8de17014e118a42f5cc0eb90a0cbfa73cc
/system/core/libsysutils/src/NetlinkEvent.cpp
b982bce73b7e2c824ffb50115ea382fe45c751a4 27-Apr-2012 JP Abgrall <jpa@google.com> Revert "libsysutils: NetlinkEvent: add support for interface xt_IDLETIMER events."

This reverts commit 731d831e91d5d9f8b15ca95367977abe35967166.

Now that the xt_IDLETIMER uses the KOBJECT_UEVENT netlink, this
change is not needed anymore.
/system/core/libsysutils/src/NetlinkEvent.cpp
731d831e91d5d9f8b15ca95367977abe35967166 11-Apr-2012 Ashish Sharma <ashishsharma@google.com> libsysutils: NetlinkEvent: add support for interface xt_IDLETIMER events.

xt_IDLETIMER events are used to infer the interface (radio) state
based on a inactivity timeout value.

Change-Id: I755eb54a048ca1c6ce0c646564d61188d8241851
/system/core/libsysutils/src/NetlinkEvent.cpp
477df68854ff0b92f1ca8f7f18d53b6a0c30102a 29-Oct-2011 Irfan Sheriff <isheriff@google.com> Remove log spam

Bug: 5533986
Change-Id: I3d8108e2f65ce6513ac8b2d14541eaa5e4fc5da1
/system/core/libsysutils/src/NetlinkEvent.cpp
e6f80149a201e02ddd1e251e0690ad100b688cd6 15-Jul-2011 JP Abgrall <jpa@google.com> NetlinkEvents: adding support for iptables' quota2 NFLOG messages.

It passes the quota2 name and the device at the time the quota was
reached.
ALERT_NAME=...
INTERFACE=...

This needs the new kernel in which xt_quota2 can log.

Change-Id: Icf5045374e1e33bdd1da0d2a2c183e70903a1fea
/system/core/libsysutils/src/NetlinkEvent.cpp
17260b14682d4fe59dad3de2de8c9370e6ba9a71 24-Jun-2011 Mike J. Chen <mjchen@google.com> Cleanup NetlinkListener and NetlinkEvent

To make it easier to be compatible with older existing code, use
default parameters instead of separate functions for setting.

Also, reintroduce the const usage that was not in the original
changes by Stan.

Also fix some indent spacing.

Change-Id: Ice9ec7f0d5c4a0673037e2e04a764d88a98f68eb
Signed-off-by: Mike J. Chen <mjchen@google.com>
/system/core/libsysutils/src/NetlinkEvent.cpp
ec16b9d47cacb0d873ee0ff80c919f49215c0005 23-Jun-2011 Mike J. Chen <mjchen@google.com> Revert "Revert "Add NETLINK_ROUTE processing to the netlink client code, so that Ethernet""

This reverts commit 1d504eeb50d980c222572629383bb76315f32ca0.

Conflicts:

libsysutils/src/NetlinkEvent.cpp

Bring back the changes from Stan Chesnutt regarding adding NETLINK_ROUTE
processing. The original commit message description was:

Add NETLINK_ROUTE processing to the netlink client code, so that Ethernet
physical-layer up/down events can be tracked. Upper layers will use these
events to enable/disable Ethernet connectivity.

The original change was reverted due to an incompatiblity with Motorola's
ril.so binary. I'll submit a patch to workaround that incompatiblity
separately.

Change-Id: I4e97ac98833b10543e654c63ecae3b9b8c7db44f
Signed-off-by: Mike J. Chen <mjchen@google.com>
/system/core/libsysutils/src/NetlinkEvent.cpp
3311eea1d3881e6f3d6806988b7db3de0a5f68d5 17-Jan-2011 David 'Digit' Turner <digit@google.com> libsysutils: Fix NetLinkEvent security issues.

The issues were the following:
- The code in decode() didn't handle the degenerate case where the input buffer is full of '@'
- The code in decode() assumed the input buffer is properly zero-terminated.
- The code in decode() would not check that it doesn't overwrite the mParams[] array.
- The code in findParam() would check mParams[i] before checking the value of 'i'

Also remove un-necessary calls to strlen() at runtime.

Change-Id: I8acead959bd10d97c5380b08958fcb796248a010
/system/core/libsysutils/src/NetlinkEvent.cpp
80ec37aa15c138beee5889a257d1241c30a1e8d7 14-Jul-2010 Chih-Wei Huang <cwhuang@linux.org.tw> libsysutils: reimplement NetlinkEvent::findParam in the proper way

The original implementation can not find correct parameters for certain
cases. For example, if you have both foo_bar and foo, try to find foo
may be mismatched. The correct way is to match with "=".

Change-Id: I403b1a7b889583a57a4f3a14e575181ce93b10ff
/system/core/libsysutils/src/NetlinkEvent.cpp
7e8529a8b528fd30586aa037f15a31b29582c537 25-Mar-2010 San Mehat <san@google.com> system/core: Switch libsysutils & sched_policy LOG -> SLOG

Change-Id: Id74c6895a8012c5915f2e259339101844de7c085
Signed-off-by: San Mehat <san@google.com>
/system/core/libsysutils/src/NetlinkEvent.cpp
d674413ff460afe1da049e54bb7a489132799749 24-Dec-2009 San Mehat <san@google.com> sysutils: Add dump() to NetlinkEvent

Signed-off-by: San Mehat <san@google.com>
/system/core/libsysutils/src/NetlinkEvent.cpp
ebfe3db361c51d9d99bf6cfd495bd16bdf815e1f 11-Oct-2009 San Mehat <san@android.com> libsysutils: Fix some bugs in NetlinkListener and NetlinkEvent

Signed-off-by: San Mehat <san@android.com>
/system/core/libsysutils/src/NetlinkEvent.cpp
03f0d27f6c49530a91402ed42f8ca4b2fda04b9f 27-May-2009 San Mehat <san@google.com> libsysutils: Fix command argument passing bug + whitespace cleanup

Signed-off-by: San Mehat <san@google.com>
/system/core/libsysutils/src/NetlinkEvent.cpp
3d40729054803fae1c4d4bb5ac7554665a132b26 07-May-2009 San Mehat <san@google.com> libsysutils: Add string.h to includes

Signed-off-by: San Mehat <san@google.com>
/system/core/libsysutils/src/NetlinkEvent.cpp
168415b822cae1f8b54ef09c41c11a9b97b87f40 06-May-2009 San Mehat <san@google.com> libsysutils: New C++ system convenience library

This library contains re-usable classes for common
system level daemons. Initial consumers of this library
are 'nexus' and 'vold2'

Signed-off-by: San Mehat <san@google.com>
/system/core/libsysutils/src/NetlinkEvent.cpp