- init: set /proc/sys/net/unix/max_dgram_qlen to 300
- libsysutils: Add listen backlog argument to startListener
- logd: set listen backlog to 300
Change-Id: Id6d37d6c937ba2d221e76258d89c9516619caeec
regression from commit a6e965578e44f9ae5f98de822ba5decec381dffc
* wrap writev with sigaction SIG_IGN SIGPIPE to emulate the
send(,,,MSG_NOSIGNAL) call it had replaced.
(cherry pick from commit 83fc720785)
BUG: 12796279
Change-Id: I14363630ada79c0a5b85bb6b2afd0a1c4d5c3109
* Foreground thread (legacy) closes connection by
reporting false return value for onDataAvailable.
* Background thread can choose instead to close the
connection asynchronously by calling release, must
return true for the onDataAvailable method.
(cherry picked from commit d7ad4e409e)
Change-Id: I70ab37d5c22b02804aa3b4dfb26cc9b75291f8b6
SocketClient:
* Replace sendDataLocked with sendDataLockedv which takes an iovec.
* Add a version of sendData, sendDatav, which takes an iovec.
* do not preserve iovec content through sendDatav
SocketListener:
* Add runOnEachSocket, which allows to to specify a SocketClientCommand to
run individually on each socket. This allows you to do broadcast-like
actions customized for each individual socket.
* Client safe list reference counting for sendBroadcast & runOnEach Socket
(cherry picked from commit a6e965578e)
Signed-off-by: Nick Kralevich <nnk@google.com>
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Change-Id: I716f89c01b4cb7af900045c7e41fac1492defb06
The kernel headers are already in the include path, and manually
adding them again will break on a multiarch build, where the
kernel headers may be different for each arch.
Change-Id: Ib13d96543f2c97b1b487a46e1748ceb2c5724169
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 b185e90dcc]
Bug: 9180552
Change-Id: I6c532c8f0ceef3afdc977a431a036df398013e1a
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 f34861346d]
Bug: 10433320
Change-Id: Ibf30efb426949dfd02304cc1d9adb1c005a539a6
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 a4b4e9ad8e]
Bug: 10232006
Change-Id: I93a50e8de17014e118a42f5cc0eb90a0cbfa73cc
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
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
Needed to support tethering of multiple remote Bluetooth devices.
Change-Id: I9f736affd83226e8b2fa4f0faacd3654175dd8c9
Signed-off-by: Patrik Ryd <patrik.ryd@stericsson.com>
It's up to the protocol to know when quotes are required. In the future
the response should probably all be binary blobs with lengths.
bug:6353048
Change-Id: I3f9b48ab0f4e6746d75cdc9c0c84d33f38f63661
xt_IDLETIMER events are used to infer the interface (radio) state
based on a inactivity timeout value.
Change-Id: I755eb54a048ca1c6ce0c646564d61188d8241851
This change is to make sure the users of library does not crash
if they are not handling SIGPIPE properly.
Change-Id: I4ea80d6bfc26a4bca6b901959ae3060b059d46d3
Sending 3digit code, null, binary-length and data. Current code sends
3digit code, space, null, binary-length, binary-data.
The space should not be sent.
Change-Id: I1df00a3e70805b39b6105966c7f3c613461a6858
Add a utility function to SocketClient to send a c-string code
prepended to a binary message. This is necessary to be able to
send a binary message while keeping compatible with underlying
text-based protocol.
Change-Id: Ifc6562003a687577d7deb50260533a5147ae4f97
Allows for one socket to be multiplexed for multiple requests.
Doesn't use command sequence numbers for broadcasts - would make no sense.
Doesn't alter current default behavior so OEM's using these classes
won't notice a difference.
bug:5864209
Change-Id: Ie3b19c4f81eea868569229a365c8cb7de249c2dd
The problem was: if a socket is shared between SocketListener and another
thread, only if the last reference is removed by SocketListener can the socket
be closed, otherwise the socket will leak. This sometimes happens in netd's
dnsproxyd.
This change let the SocketClient own the socket and close the socket when
the SocketClient is destructed.
Change-Id: I2865fbfe9ee4d8b3e43d7e02919dbb2d261f70de
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
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>
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>
This reverts commit 1d504eeb50.
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>
Verify that netlink messages are actually from the kernel,
and not from a userspace program.
This is a manual cherry-pick from b620a0b1c7
Change-Id: I237f0a5cb56393bb3aab64a7ae5898f2bdc95cef