@@ -309,6 +309,8 @@ int pb_protocol_config_len(const struct config *config)
for (i = 0; i < config->network.n_dns_servers; i++)
len += 4 + optional_strlen(config->network.dns_servers[i]);
+ len += 4 /* config->network.addr_type */;
+
len += 4 + optional_strlen(config->http_proxy);
len += 4 + optional_strlen(config->https_proxy);
@@ -581,6 +583,9 @@ int pb_protocol_serialise_config(const struct config *config,
config->network.dns_servers[i]);
}
+ *(uint32_t *)pos = __cpu_to_be32(config->network.addr_type);
+ pos += 4;
+
pos += pb_protocol_serialise_string(pos, config->http_proxy);
pos += pb_protocol_serialise_string(pos, config->https_proxy);
@@ -1141,6 +1146,10 @@ int pb_protocol_deserialise_config(struct config *config,
config->network.dns_servers[i] = str;
}
+ if (read_u32(&pos, &len, &tmp))
+ goto out;
+ config->network.addr_type = tmp;
+
if (read_string(config, &pos, &len, &str))
goto out;
config->http_proxy = str;
@@ -162,6 +162,10 @@ struct network_config {
unsigned int n_interfaces;
const char **dns_servers;
unsigned int n_dns_servers;
+ enum {
+ ADDR_IPV4,
+ ADDR_IPV6,
+ } addr_type;
};
struct autoboot_option {
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> --- lib/pb-protocol/pb-protocol.c | 9 +++++++++ lib/types/types.h | 4 ++++ 2 files changed, 13 insertions(+)