summaryrefslogtreecommitdiffstats
path: root/src/vnet/udp
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-04-07 03:46:07 +0000
committerDave Barach <openvpp@barachs.net>2020-04-07 14:46:47 +0000
commitab57edb8d27ddf0fb30cd0f4ae5290c06f301599 (patch)
tree1dcfb91dac9c9bebdf36707f183d3f12b0982b42 /src/vnet/udp
parentba78e2380e86926c7e29bc3538eb7ac4e78699b1 (diff)
udp session: allow dgram ip fragmentation
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ida8f9e759b4990ea6e34e71dc45bdb3b5eabc27f
Diffstat (limited to 'src/vnet/udp')
-rw-r--r--src/vnet/udp/udp.c13
-rw-r--r--src/vnet/udp/udp.h7
2 files changed, 8 insertions, 12 deletions
diff --git a/src/vnet/udp/udp.c b/src/vnet/udp/udp.c
index daab453f43d..8f26b57bb3f 100644
--- a/src/vnet/udp/udp.c
+++ b/src/vnet/udp/udp.c
@@ -241,15 +241,12 @@ udp_push_header (transport_connection_t * tc, vlib_buffer_t * b)
vlib_buffer_push_udp (b, uc->c_lcl_port, uc->c_rmt_port, 1);
if (tc->is_ip4)
- vlib_buffer_push_ip4 (vm, b, &uc->c_lcl_ip4, &uc->c_rmt_ip4,
- IP_PROTOCOL_UDP, 1);
+ vlib_buffer_push_ip4_custom (vm, b, &uc->c_lcl_ip4, &uc->c_rmt_ip4,
+ IP_PROTOCOL_UDP, 1 /* csum offload */ ,
+ 0 /* is_df */ );
else
- {
- ip6_header_t *ih;
- ih = vlib_buffer_push_ip6 (vm, b, &uc->c_lcl_ip6, &uc->c_rmt_ip6,
- IP_PROTOCOL_UDP);
- vnet_buffer (b)->l3_hdr_offset = (u8 *) ih - b->data;
- }
+ vlib_buffer_push_ip6 (vm, b, &uc->c_lcl_ip6, &uc->c_rmt_ip6,
+ IP_PROTOCOL_UDP);
vnet_buffer (b)->sw_if_index[VLIB_RX] = 0;
vnet_buffer (b)->sw_if_index[VLIB_TX] = uc->c_fib_index;
b->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
diff --git a/src/vnet/udp/udp.h b/src/vnet/udp/udp.h
index f7985c928c2..ddc9a0eb27d 100644
--- a/src/vnet/udp/udp.h
+++ b/src/vnet/udp/udp.h
@@ -308,10 +308,9 @@ vlib_buffer_push_udp (vlib_buffer_t * b, u16 sp, u16 dp, u8 offload_csum)
uh->checksum = 0;
uh->length = clib_host_to_net_u16 (udp_len);
if (offload_csum)
- {
- b->flags |= VNET_BUFFER_F_OFFLOAD_UDP_CKSUM;
- vnet_buffer (b)->l4_hdr_offset = (u8 *) uh - b->data;
- }
+ b->flags |= VNET_BUFFER_F_OFFLOAD_UDP_CKSUM;
+ vnet_buffer (b)->l4_hdr_offset = (u8 *) uh - b->data;
+ b->flags |= VNET_BUFFER_F_L4_HDR_OFFSET_VALID;
return uh;
}