dhcp: Clear IP address before discovering DHCP

Clear IP address before sending DHCP discover message. Otherwise when
device has been assigned different address previously, it will drop DHCP
offer from server, because destination IP from TCP header won't match
assigned IP and the packet will be dropped.

This situation may happen when fastboot was closed and started again
without resetting AP and DHCP server decides to offer different IP
address than the previously assigned.

BRANCH=main
BUG=None
TEST=Use bootloader fastboot

Change-Id: I9efa5d6a6785518cc510f194caf2bcda178a981e
Signed-off-by: Tomasz Michalec <tmichalec@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/depthcharge/+/7551591
Commit-Queue: Julius Werner <jwerner@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
1 file changed
tree: 04f2f51f3c15061c09017405e0e2680949cf69d2
  1. configs/
  2. screenshot/
  3. src/
  4. tests/
  5. util/
  6. .checkpatch.conf
  7. .clang-format
  8. .gitignore
  9. COPYING
  10. Kconfig
  11. LICENSE
  12. Makefile
  13. Makefile.inc
  14. OWNERS
  15. PRESUBMIT.cfg
  16. PRESUBMIT.py
  17. README.md
  18. unblocked_terms.txt
README.md

Depthcharge

Depthcharge is a bootloader for ChromeOS devices. It is responsible for initializing hardware, setting up the boot environment, and loading the operating system.

Key Features

  • Hardware Initialization: Initializes and configures the system's hardware components, including memory, storage, and peripherals.
  • Boot Environment Setup: Sets up the necessary environment for the operating system to boot, including memory, storage, and other peripherals.
  • Booting the Operating System: Loads and executes the operating system kernel.
  • Security Features: Implements various security features, such as secure boot and verified boot, using the vboot library.

Project Structure

  • src/: Contains the source code for the depthcharge bootloader.
  • board/: Contains the board-specific configuration files.
  • src/drivers/: Contains the device drivers.

Build Instructions

To build depthcharge, you will need a ChromeOS development environment. Within the chroot:

emerge-$BOARD sys-boot/depthcharge

Remember to build it before you build `chromeos-bootimage`!