dhcp: add internal option for the boot file name

Add an internal option that specifies the boot file name from the DHCP
header. The option name 'filename' is the same as exposed by dhclient.

(cherry picked from commit 0994a444e5)
This commit is contained in:
Beniamino Galvani 2021-07-18 18:09:26 +02:00
parent 5f85f1631b
commit 667f2a5d76
2 changed files with 4 additions and 2 deletions

View file

@ -169,6 +169,7 @@ const NMDhcpOption _nm_dhcp_option_dhcp4_options[] = {
REQ(NM_DHCP_OPTION_DHCP4_NM_IP_ADDRESS, "ip_address", FALSE),
REQ(NM_DHCP_OPTION_DHCP4_NM_EXPIRY, "expiry", FALSE),
REQ(NM_DHCP_OPTION_DHCP4_NM_NEXT_SERVER, "next_server", FALSE),
REQ(NM_DHCP_OPTION_DHCP4_NM_FILENAME, "filename", FALSE),
};
static const NMDhcpOption *const _sorted_options_4[G_N_ELEMENTS(_nm_dhcp_option_dhcp4_options)] = {
@ -184,7 +185,7 @@ static const NMDhcpOption *const _sorted_options_4[G_N_ELEMENTS(_nm_dhcp_option_
A(98), A(99), A(100), A(101), A(102), A(103), A(104), A(105), A(106), A(107), A(108), A(109),
A(110), A(111), A(112), A(113), A(114), A(115), A(116), A(117), A(118), A(119), A(120), A(121),
A(122), A(123), A(124), A(125), A(126), A(127), A(128), A(129), A(130), A(131), A(132), A(133),
A(134), A(15), A(135), A(136), A(16), A(137), A(138), A(139), A(140), A(141),
A(134), A(15), A(135), A(136), A(16), A(137), A(138), A(139), A(140), A(141), A(142),
#undef A
};

View file

@ -153,6 +153,7 @@ typedef enum {
NM_DHCP_OPTION_DHCP4_NM_IP_ADDRESS = 1024,
NM_DHCP_OPTION_DHCP4_NM_EXPIRY = 1025,
NM_DHCP_OPTION_DHCP4_NM_NEXT_SERVER = 1026,
NM_DHCP_OPTION_DHCP4_NM_FILENAME = 1027, /* 'file' DHCP header */
} NMDhcpOptionDhcp4Options;
typedef enum {
@ -185,7 +186,7 @@ typedef struct {
bool include;
} NMDhcpOption;
extern const NMDhcpOption _nm_dhcp_option_dhcp4_options[142];
extern const NMDhcpOption _nm_dhcp_option_dhcp4_options[143];
extern const NMDhcpOption _nm_dhcp_option_dhcp6_options[16];
static inline const char *