summaryrefslogtreecommitdiffstats
path: root/sbin/dhclient
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/dhclient')
-rw-r--r--sbin/dhclient/bpf.c8
-rw-r--r--sbin/dhclient/clparse.c6
-rw-r--r--sbin/dhclient/conflex.c2
-rw-r--r--sbin/dhclient/dhcpd.h1
-rw-r--r--sbin/dhclient/dhctoken.h1
-rw-r--r--sbin/dhclient/tables.c1
6 files changed, 19 insertions, 0 deletions
diff --git a/sbin/dhclient/bpf.c b/sbin/dhclient/bpf.c
index 78b9eb6..30f988c 100644
--- a/sbin/dhclient/bpf.c
+++ b/sbin/dhclient/bpf.c
@@ -86,6 +86,14 @@ if_register_bpf(struct interface_info *info, int flags)
error("Can't attach interface %s to bpf device %s: %m",
info->name, filename);
+ /* Tag the packets with the proper VLAN PCP setting. */
+ if (info->client->config->vlan_pcp != 0) {
+ if (ioctl(sock, BIOCSETPCP,
+ &info->client->config->vlan_pcp) < 0)
+ error( "Can't set the VLAN PCP tag on interface %s: %m",
+ info->name);
+ }
+
return (sock);
}
diff --git a/sbin/dhclient/clparse.c b/sbin/dhclient/clparse.c
index 4dc1113..c6f3c55 100644
--- a/sbin/dhclient/clparse.c
+++ b/sbin/dhclient/clparse.c
@@ -75,6 +75,7 @@ read_client_conf(void)
memset(&top_level_config, 0, sizeof(top_level_config));
/* Set some defaults... */
+ top_level_config.vlan_pcp = 0;
top_level_config.timeout = 60;
top_level_config.select_interval = 0;
top_level_config.reboot_timeout = 10;
@@ -200,6 +201,7 @@ parse_client_statement(FILE *cfile, struct interface_info *ip,
int token;
char *val;
struct option *option;
+ time_t tmp;
switch (next_token(&val, cfile)) {
case SEND:
@@ -259,6 +261,10 @@ parse_client_statement(FILE *cfile, struct interface_info *ip,
case REBOOT:
parse_lease_time(cfile, &config->reboot_timeout);
return;
+ case VLAN_PCP:
+ parse_lease_time(cfile, &tmp);
+ config->vlan_pcp = (u_int)tmp;
+ return;
case BACKOFF_CUTOFF:
parse_lease_time(cfile, &config->backoff_cutoff);
return;
diff --git a/sbin/dhclient/conflex.c b/sbin/dhclient/conflex.c
index 776d8fa..88dfd5d 100644
--- a/sbin/dhclient/conflex.c
+++ b/sbin/dhclient/conflex.c
@@ -521,6 +521,8 @@ intern(char *atom, int dfv)
case 'v':
if (!strcasecmp(atom + 1, "endor-class"))
return (VENDOR_CLASS);
+ if (!strcasecmp(atom + 1, "lan-pcp"))
+ return (VLAN_PCP);
break;
case 'y':
if (!strcasecmp(atom + 1, "iaddr"))
diff --git a/sbin/dhclient/dhcpd.h b/sbin/dhclient/dhcpd.h
index ee5d791..dc75d6d 100644
--- a/sbin/dhclient/dhcpd.h
+++ b/sbin/dhclient/dhcpd.h
@@ -154,6 +154,7 @@ struct client_config {
u_int8_t required_options[256];
u_int8_t requested_options[256];
int requested_option_count;
+ u_int vlan_pcp;
time_t timeout;
time_t initial_interval;
time_t retry_interval;
diff --git a/sbin/dhclient/dhctoken.h b/sbin/dhclient/dhctoken.h
index 26c81aa..c929307 100644
--- a/sbin/dhclient/dhctoken.h
+++ b/sbin/dhclient/dhctoken.h
@@ -133,6 +133,7 @@
#define AUTHORITATIVE 333
#define TOKEN_NOT 334
#define ALWAYS_REPLY_RFC1048 335
+#define VLAN_PCP 336
#define is_identifier(x) ((x) >= FIRST_TOKEN && \
(x) != STRING && \
diff --git a/sbin/dhclient/tables.c b/sbin/dhclient/tables.c
index 204de5a..9150d55 100644
--- a/sbin/dhclient/tables.c
+++ b/sbin/dhclient/tables.c
@@ -400,6 +400,7 @@ unsigned char dhcp_option_default_priority_list[] = {
DHO_IRC_SERVER,
DHO_STREETTALK_SERVER,
DHO_STREETTALK_DA_SERVER,
+ DHO_DHCP_USER_CLASS_ID,
DHO_DOMAIN_SEARCH,
/* Presently-undefined options... */
OpenPOWER on IntegriCloud