ip: fix cancel termination after receive malformed ip6 packet
[vpp.git] / src / vnet / ip / ip.h
index 65ccaef..587ec85 100644 (file)
@@ -46,6 +46,7 @@
 
 #include <vnet/vnet.h>
 
+#include <vnet/ip/ip_types.h>
 #include <vnet/ip/format.h>
 #include <vnet/ip/ip_packet.h>
 #include <vnet/ip/lookup.h>
 #include <vnet/ip/icmp6.h>
 #include <vnet/classify/vnet_classify.h>
 
-typedef enum ip_address_family_t_
-{
-  AF_IP4,
-  AF_IP6,
-} ip_address_family_t;
-
-extern uword unformat_ip_address_family (unformat_input_t * input,
-                                        va_list * args);
-extern u8 *format_ip_address_family (u8 * s, va_list * args);
-
-#define FOR_EACH_IP_ADDRESS_FAMILY(_af) \
-  for (_af = AF_IP4; _af <= AF_IP6; _af++)
-
-#define u8_ptr_add(ptr, index) (((u8 *)ptr) + index)
-#define u16_net_add(u, val) clib_host_to_net_u16(clib_net_to_host_u16(u) + (val))
-
 /* Per protocol info. */
 typedef struct
 {
@@ -228,7 +213,6 @@ ip_calculate_l4_checksum (vlib_main_t * vm, vlib_buffer_t * p0,
              n_this_buffer = n_ip_bytes_this_buffer - ip_header_size;
              if (PREDICT_FALSE (n_this_buffer >> 31))
                {               /*  error - ip header don't fit this buffer */
-                 ASSERT (0);
                  return 0xfefe;
                }
            }
@@ -250,7 +234,6 @@ ip_calculate_l4_checksum (vlib_main_t * vm, vlib_buffer_t * p0,
 
       if (!(p0->flags & VLIB_BUFFER_NEXT_PRESENT))
        {
-         ASSERT (0);           /* error - more buffer expected */
          return 0xfefe;
        }