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/NetlinkListener.cpp
|
d98533a01213ef8d4ef9a644074ada200cdfc926 |
|
30-Mar-2012 |
Geremy Condra <gcondra@google.com> |
Added netlink failure logging to NetlinkListener.cpp This depends on If2f00708a1dd6196c415b1ebc2a7eeb72399a90e Change-Id: If6c63e46f906b94f4778eb5e78123d8efe1710d4
/system/core/libsysutils/src/NetlinkListener.cpp
|
2a56688da92fcf22ea8ce996e2a0e7b453d1543b |
|
24-Jun-2011 |
Mike J. Chen <mjchen@google.com> |
Workaround Motorola ril.so incompatiblity with Netlink changes To workaround a binary incompatiblity with Motorola's ril.so, I had to temporarily provide the old constructor for NetlinkListener as well as a new contructor that takes an additional format argument. There's still a slight chance of a problem because the size of the NetlinkListener has changed with the addition of the mFormat member, but so far I've not seen any obvious problem with that incompatiblity. Another way we could have worked around the incompatiblity is to have netd (the main user of the new format argument to NetlinkListener) keep track of the format itself in it's NetlinkHandler (derived from NetlinkListener) and supply it's own version of onDataAvailable() that's almost 100% identical to NetlinkListener's except for the decode() call. That would allow us not to modify NetlinkListener at all. Worth considering but I think it's more properly divided right now and we just have to make Motorola fix their code (and ideally not use our private APIs). This change should be reverted when Motorola's has fixed their ril to either not use our private APIs or to use our updated ones. Change-Id: I255cca6908444e56cbbbed7eef1fa0cf1d8f0918 Signed-off-by: Mike J. Chen <mjchen@google.com>
/system/core/libsysutils/src/NetlinkListener.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/NetlinkListener.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/NetlinkListener.cpp
|
57de8b8f27f887ca8084671df777a4ac199ba647 |
|
11-May-2011 |
Nick Kralevich <nnk@google.com> |
rename uevent_checked_recv to uevent_kernel_multicast_recv Change-Id: I1839627490080efcbb7269699709064856312f8b
/system/core/libsysutils/src/NetlinkListener.cpp
|
531312e491079b7d62612fa35b64e8398f1b3283 |
|
30-Apr-2011 |
Nick Kralevich <nnk@google.com> |
NetlinkListener: eliminate duplicate code The checks in this code duplicate uevent_checked_recv(). Use that instead. Change-Id: I2c48bcf4372f0975c27a63d929cae73e16422faf
/system/core/libsysutils/src/NetlinkListener.cpp
|
6bc08280108d020edfceff039f3955eebdc1e45c |
|
19-Apr-2011 |
Nick Kralevich <nnk@google.com> |
Validate sender credentials on netlink msg receive Verify that netlink messages are actually from the kernel, and not from a userspace program. This is a manual cherry-pick from b620a0b1c7ae486e979826200e8e441605b0a5d6 Change-Id: I237f0a5cb56393bb3aab64a7ae5898f2bdc95cef
/system/core/libsysutils/src/NetlinkListener.cpp
|
b59539d395218299f4b4288a26403fedb3d8124c |
|
17-Jan-2011 |
David 'Digit' Turner <digit@google.com> |
libsysutils: Handle EINTR in NetlinkListener Change-Id: Id881a9ca0f0e54f7c78b3609120bedec00d6671c
/system/core/libsysutils/src/NetlinkListener.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/NetlinkListener.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/NetlinkListener.cpp
|
fa644ffe944c01a9b00f8d7676d58394fabee285 |
|
08-May-2009 |
San Mehat <san@google.com> |
libsysutils: Add multiple client support and fix some bugs
/system/core/libsysutils/src/NetlinkListener.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/NetlinkListener.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/NetlinkListener.cpp
|