summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2016-03-07 17:10:36 -0500
committerDave Barach <dave@barachs.net>2016-03-07 17:13:23 -0500
commitb1df1699d73d010d6af5af05e85d843508d4f8e8 (patch)
treea1d062442f205480cafe1c9c5440ed72ce005f4c
parentd255a2782a6d1634c5f1da9931b7c0c44ae2345b (diff)
Fix longstanding cleanup-flag bug
Change-Id: I9b325b454ef80ffff80a0b0e23b24e3313127376 Signed-off-by: Dave Barach <dave@barachs.net>
-rw-r--r--vnet/vnet/sr/sr.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/vnet/vnet/sr/sr.c b/vnet/vnet/sr/sr.c
index 5cc33dc93e6..cb74a163474 100644
--- a/vnet/vnet/sr/sr.c
+++ b/vnet/vnet/sr/sr.c
@@ -1659,14 +1659,13 @@ sr_local (vlib_main_t * vm,
ip0->dst_address.as_u64[1] = new_dst0->as_u64[1];
if (PREDICT_TRUE (sr0->segments_left > 0))
- {
sr0->segments_left -= 1;
- goto do_trace0;
- }
}
/* End of the path. Clean up the SR header, or not */
- if (sr0->flags & clib_host_to_net_u16(IP6_SR_HEADER_FLAG_CLEANUP))
+ if (PREDICT_FALSE
+ (sr0->segments_left == 0 &&
+ (sr0->flags & clib_host_to_net_u16(IP6_SR_HEADER_FLAG_CLEANUP))))
{
u64 *copy_dst0, *copy_src0;
u16 new_l0;
@@ -1765,14 +1764,13 @@ sr_local (vlib_main_t * vm,
ip1->dst_address.as_u64[1] = new_dst1->as_u64[1];
if (PREDICT_TRUE (sr1->segments_left > 0))
- {
sr1->segments_left -= 1;
- goto do_trace1;
- }
}
/* End of the path. Clean up the SR header, or not */
- if (sr1->flags & clib_host_to_net_u16(IP6_SR_HEADER_FLAG_CLEANUP))
+ if (PREDICT_FALSE
+ (sr1->segments_left == 0 &&
+ (sr1->flags & clib_host_to_net_u16(IP6_SR_HEADER_FLAG_CLEANUP))))
{
u64 *copy_dst1, *copy_src1;
u16 new_l1;
@@ -1892,14 +1890,13 @@ sr_local (vlib_main_t * vm,
ip0->dst_address.as_u64[1] = new_dst0->as_u64[1];
if (PREDICT_TRUE (sr0->segments_left > 0))
- {
sr0->segments_left -= 1;
- goto do_trace;
- }
}
/* End of the path. Clean up the SR header, or not */
- if (sr0->flags & clib_host_to_net_u16(IP6_SR_HEADER_FLAG_CLEANUP))
+ if (PREDICT_FALSE
+ (sr0->segments_left == 0 &&
+ (sr0->flags & clib_host_to_net_u16(IP6_SR_HEADER_FLAG_CLEANUP))))
{
u64 *copy_dst0, *copy_src0;
u16 new_l0;