OSDN Git Service

Catch runtime exceptions when parsing DHCP packets
authorHugo Benichi <hugobenichi@google.com>
Wed, 5 Oct 2016 09:33:21 +0000 (18:33 +0900)
committerHugo Benichi <hugobenichi@google.com>
Wed, 5 Oct 2016 12:58:26 +0000 (21:58 +0900)
commite0ea7fecd63002ac2d3df18490fd1c16578d1935
tree637ad9a456414581168da353e063e74c894b2932
parentf4dabe3ecf764d504767cd52de59e69a7b5f2676
Catch runtime exceptions when parsing DHCP packets

This patch adds a try catch all to DHCP packet parsing so that
DhcpClient does not choke on malformed packets, brinding down with it
the whole framework.

Test: added new unit tests catching the issue fixed in this patch.
Bug: 31850211
Change-Id: I3c50a149fed6b2cbc4f40bb4f0e5bb2b56859b44
core/java/android/net/metrics/DhcpErrorEvent.java
services/net/java/android/net/dhcp/DhcpPacket.java
services/tests/servicestests/src/android/net/dhcp/DhcpPacketTest.java