summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/buffer.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/vnet/buffer.h b/src/vnet/buffer.h
index fb734d5acde..bd70ea2722f 100644
--- a/src/vnet/buffer.h
+++ b/src/vnet/buffer.h
@@ -524,8 +524,17 @@ format_function_t format_vnet_buffer_offload;
static_always_inline void
vnet_buffer_offload_flags_set (vlib_buffer_t *b, u32 oflags)
{
- vnet_buffer2 (b)->oflags |= oflags;
- b->flags |= VNET_BUFFER_F_OFFLOAD;
+ if (b->flags & VNET_BUFFER_F_OFFLOAD)
+ {
+ /* add a flag to existing offload */
+ vnet_buffer2 (b)->oflags |= oflags;
+ }
+ else
+ {
+ /* no offload yet: reset offload flags to new value */
+ vnet_buffer2 (b)->oflags = oflags;
+ b->flags |= VNET_BUFFER_F_OFFLOAD;
+ }
}
static_always_inline void