X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fip%2Fip.h;h=b114fcbaaf66af4987383f670ff547303e97955e;hb=609e121;hp=747b438581646f1fc46c6dfb971cab252b469abd;hpb=477e91a6d6a2b83b1e08d0ba4a04bcc91970f82e;p=vpp.git diff --git a/src/vnet/ip/ip.h b/src/vnet/ip/ip.h index 747b4385816..b114fcbaaf6 100644 --- a/src/vnet/ip/ip.h +++ b/src/vnet/ip/ip.h @@ -65,6 +65,9 @@ #include #include +#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 { @@ -159,7 +162,7 @@ ip_incremental_checksum_buffer (vlib_main_t * vm, void *h; u32 n; - n = clib_min (n_bytes_left, b->current_length); + n = clib_min (n_bytes_left, b->current_length - first_buffer_offset); h = vlib_buffer_get_current (b) + first_buffer_offset; sum = ip_incremental_checksum (sum, h, n); if (PREDICT_FALSE (b->flags & VLIB_BUFFER_NEXT_PRESENT))