summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorSusant Sahani <susant@redhat.com>2014-07-14 13:34:18 +0530
committerTom Gundersen <teg@jklm.no>2014-07-14 11:39:20 +0200
commitedb85f0d8d0a84f27308a3728f3fde3c52b9dce2 (patch)
tree21f738340ce15e0230d82b53e471c89c3df89791 /src/network
parent5d8e593dce074bff966fc0a46579c61b4f3bc33a (diff)
networkd: dhcp add vendor class indentifier option 60
Vendor Class Identifier be used by DHCP clients to identify their vendor type and configuration. When using this option, vendors can define their own specific identifier values, such as to convey a particular hardware or operating system configuration or other identifying information. Vendor-specified DHCP options—features that let administrators assign separate options to clients with similar configuration requirements. For example, if DHCP-aware clients for example we want to separate different gateway and option for different set of people (dev/test/hr/finance) in a org or devices for example web/database servers or let's say in a embedded device etc and require a different default gateway or DNS server than the rest of clients.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-link.c7
-rw-r--r--src/network/networkd-network-gperf.gperf1
-rw-r--r--src/network/networkd-network.c1
-rw-r--r--src/network/networkd.h2
4 files changed, 11 insertions, 0 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 5f6c22a611..9e057ce0ff 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -2023,6 +2023,13 @@ static int link_configure(Link *link) {
return r;
}
}
+
+ if (link->network->dhcp_vendor_class_identifier) {
+ r = sd_dhcp_client_set_vendor_class_identifier(link->dhcp_client,
+ link->network->dhcp_vendor_class_identifier);
+ if (r < 0)
+ return r;
+ }
}
if (link->network->dhcp_server) {
diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf
index 50cb0f8be9..5c1c013373 100644
--- a/src/network/networkd-network-gperf.gperf
+++ b/src/network/networkd-network-gperf.gperf
@@ -51,6 +51,7 @@ DHCP.UseDomainName, config_parse_bool, 0,
DHCP.UseRoutes, config_parse_bool, 0, offsetof(Network, dhcp_routes)
DHCP.SendHostname, config_parse_bool, 0, offsetof(Network, dhcp_sendhost)
DHCP.CriticalConnection, config_parse_bool, 0, offsetof(Network, dhcp_critical)
+DHCP.VendorClassIdentifier, config_parse_string, 0, offsetof(Network, dhcp_vendor_class_identifier)
/* backwards compatibility: do not add new entries to this section */
DHCPv4.UseDNS, config_parse_bool, 0, offsetof(Network, dhcp_dns)
DHCPv4.UseMTU, config_parse_bool, 0, offsetof(Network, dhcp_mtu)
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index 9f6de18538..c108ad2358 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -166,6 +166,7 @@ void network_free(Network *network) {
free(network->match_name);
free(network->description);
+ free(network->dhcp_vendor_class_identifier);
while ((address = network->ntp)) {
LIST_REMOVE(addresses, network->ntp, address);
diff --git a/src/network/networkd.h b/src/network/networkd.h
index aca3b8dd24..0f0ecd5c43 100644
--- a/src/network/networkd.h
+++ b/src/network/networkd.h
@@ -175,6 +175,8 @@ struct Network {
char *match_driver;
char *match_type;
char *match_name;
+ char *dhcp_vendor_class_identifier;
+
Condition *match_host;
Condition *match_virt;
Condition *match_kernel;