Skip to content

Commit ddf0943

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 eaac662 commit ddf0943

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
@@ -325,7 +325,8 @@ int32_t krun_add_virtiofs2(uint32_t ctx_id,
325325

326326
/* Send the VFKIT magic after establishing the connection,
327327
as required by gvproxy in vfkit mode. */
328-
#define NET_FLAG_VFKIT 1 << 0
328+
#define NET_FLAG_VFKIT (1 << 0)
329+
#define NET_FLAG_DHCP_CLIENT (1 << 1)
329330

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

0 commit comments

Comments
 (0)