Skip to content
Commit e59d031f authored by Remi NGUYEN VAN's avatar Remi NGUYEN VAN
Browse files

Fix BOOTP fields for server-generated DHCP packets

Set siaddr to the server address instead of zero in DHCPOFFER
Set siaddr to zero instead of the server address in DHCPNAK
Set giaddr to the relay address instead of the server address in
DHCPNAK
Set giaddr to the relay address instead of zero on DHCPACK and
DHCPOFFER
Set server identifier option in DHCPNAK

Current code is not compliant with RFC2131 and does not match dnsmasq
behavior. It was not an issue until now since the packets were only used
by the DHCP client, which does not send DHCPOFFER or DHCPNAK.

Bug: b/109584964
Test: following DhcpServerTest.py regression tests pass:
      test_discover_bootpfields
      test_request_selecting_inuse
      test_request_rebinding_relayed
      test_discover_relayed_broadcastbit
      test_request_rebinding_wrongaddr_relayed
      Also: atest FrameworksNetTests

Change-Id: Ie0bf780498e38945444bff66ca499cff5983a97f
parent b825510b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment