DHCP complete event sends mask length
[vpp.git] / src / vnet / dhcp / client.c
index 8a1a43b..014f17a 100644 (file)
@@ -14,7 +14,7 @@
  */
 #include <vlib/vlib.h>
 #include <vnet/dhcp/client.h>
-#include <vnet/dhcp/proxy.h>
+#include <vnet/dhcp/dhcp_proxy.h>
 #include <vnet/fib/fib_table.h>
 
 dhcp_client_main_t dhcp_client_main;
@@ -194,7 +194,7 @@ int dhcp_client_for_us (u32 bi, vlib_buffer_t * b,
       /* OK, we own the address (etc), add to the routing table(s) */
       if (c->state == DHCP_REQUEST)
         {
-          void (*fp)(u32, u32, u8 *, u8, u8 *, u8 *, u8 *) = c->event_callback;
+          void (*fp)(u32, u32, u8 *, u8, u8, u8 *, u8 *, u8 *) = c->event_callback;
 
           dhcp_client_acquire_address (dcm, c);
 
@@ -236,6 +236,7 @@ int dhcp_client_for_us (u32 bi, vlib_buffer_t * b,
             (*fp) (c->client_index,  /* clinet index */
                    c->pid,
                    c->hostname,
+                   c->subnet_mask_width,
                    0, /* is_ipv6 */
                    (u8 *)&c->leased_address,  /* host IP address */
                    (u8 *)&c->router_address,  /* router IP address */
@@ -366,7 +367,7 @@ send_dhcp_pkt (dhcp_client_main_t * dcm, dhcp_client_t * c,
   o = (dhcp_option_t * )dhcp->options;
 
   /* Send option 53, the DHCP message type */
-  o->option = 53;
+  o->option = DHCP_PACKET_OPTION_MSG_TYPE;
   o->length = 1;
   o->data[0] = type;
   o = (dhcp_option_t *) (((uword) o) + (o->length + 2));
@@ -781,8 +782,7 @@ int dhcp_client_add_del (dhcp_client_add_del_args_t * a)
                                      c->sw_if_index),
                                  &all_1s,
                                  FIB_SOURCE_DHCP,
-                                 FIB_ENTRY_FLAG_LOCAL,
-                                 ADJ_INDEX_INVALID);
+                                 FIB_ENTRY_FLAG_LOCAL);
 
      /*
        * enable the interface to RX IPv4 packets