diff options
Diffstat (limited to 'src/vnet/dhcp/dhcp_api.c')
-rw-r--r-- | src/vnet/dhcp/dhcp_api.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/vnet/dhcp/dhcp_api.c b/src/vnet/dhcp/dhcp_api.c index 7eb2bf46a06..7935ad8ba01 100644 --- a/src/vnet/dhcp/dhcp_api.c +++ b/src/vnet/dhcp/dhcp_api.c @@ -28,6 +28,7 @@ #include <vnet/dhcp/dhcp6_ia_na_client_dp.h> #include <vnet/dhcp/dhcp6_client_common_dp.h> #include <vnet/fib/fib_table.h> +#include <vnet/ip/ip_types_api.h> #include <vnet/vnet_msg_enum.h> @@ -263,6 +264,7 @@ dhcp_client_data_encode (vl_api_dhcp_client_t * vclient, else vclient->want_dhcp_event = 0; vclient->set_broadcast_flag = client->set_broadcast_flag; + vclient->dscp = ip_dscp_encode (client->dscp); vclient->pid = client->pid; } @@ -292,14 +294,13 @@ static void vl_api_dhcp_client_config_t_handler vlib_main_t *vm = vlib_get_main (); vl_api_dhcp_client_config_reply_t *rmp; u32 sw_if_index; + ip_dscp_t dscp; int rv = 0; + VALIDATE_SW_IF_INDEX (&(mp->client)); + sw_if_index = ntohl (mp->client.sw_if_index); - if (!vnet_sw_if_index_is_api_valid (sw_if_index)) - { - rv = VNET_API_ERROR_INVALID_SW_IF_INDEX; - goto bad_sw_if_index; - } + dscp = ip_dscp_decode (mp->client.dscp); rv = dhcp_client_config (mp->is_add, mp->client_index, @@ -310,10 +311,10 @@ static void vl_api_dhcp_client_config_t_handler (mp->client.want_dhcp_event ? dhcp_compl_event_callback : NULL), - mp->client.set_broadcast_flag, mp->client.pid); + mp->client.set_broadcast_flag, + dscp, mp->client.pid); BAD_SW_IF_INDEX_LABEL; - REPLY_MACRO (VL_API_DHCP_CLIENT_CONFIG_REPLY); } |