Skip to content

Commit 1d8429c

Browse files
committed
init: embed a simple DHCP client
If there's a eth0 interface present, and one of the interfaces has been configured with the newly introduced NET_FLAG_DHCP_CLIENT flag, the embedded dhcp client will try to obtain an address. For 2.x we should be more flexible and actually allow both dhcp and static IP configuration on specific interfaces (identified by their MAC addresses, since ifnames aren't deterministic), but this should be good enough for 1.x. Signed-off-by: Sergio Lopez <[email protected]>
1 parent a3b7ae2 commit 1d8429c

8 files changed

Lines changed: 638 additions & 6 deletions

File tree

include/libkrun.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,8 @@ int32_t krun_add_virtiofs3(uint32_t ctx_id,
354354

355355
/* Send the VFKIT magic after establishing the connection,
356356
as required by gvproxy in vfkit mode. */
357-
#define NET_FLAG_VFKIT 1 << 0
357+
#define NET_FLAG_VFKIT (1 << 0)
358+
#define NET_FLAG_DHCP_CLIENT (1 << 1)
358359

359360
/* TSI (Transparent Socket Impersonation) feature flags for vsock */
360361
#define KRUN_TSI_HIJACK_INET (1 << 0)

0 commit comments

Comments
 (0)