OSDN Git Service

Fix two parsing bugs in new DHCP client.
authorLorenzo Colitti <lorenzo@google.com>
Mon, 6 Jul 2015 03:29:43 +0000 (12:29 +0900)
committerLorenzo Colitti <lorenzo@google.com>
Mon, 6 Jul 2015 04:50:53 +0000 (13:50 +0900)
commitb0b3d0bcfb0af678d4c85bec63722f976ffb01cf
tree9079c36ac4d780c4b75aa76b159509853b5579ac
parent738a8dfcdca8536cf00077f8184d75e1c5b52b9c
Fix two parsing bugs in new DHCP client.

1. We don't parse PAD options properly, leading in failure to
   parse packets sent by DHCP servers that put the end of options
   marker after pad options and at an odd offset.
2. We get the DhcpResults vendorInfo from the wrong option type
   (60 instead of 43).

Fix these and add unit tests for the offer packets sent by a few
different DHCP servers.

Bug: 21955617
Bug: 22281295
Change-Id: I5d13f1a6a3ff0b53112f18f3db8792fa32ad2da3
services/net/java/android/net/dhcp/DhcpPacket.java
services/tests/servicestests/src/android/net/dhcp/DhcpPacketTest.java