Skip to content

Commit 86b9bbd

Browse files
tohojodavem330
authored andcommitted
sch_cake: fix srchost/dsthost hashing mode
When adding support for using the skb->hash value as the flow hash in CAKE, I accidentally introduced a logic error that broke the host-only isolation modes of CAKE (srchost and dsthost keywords). Specifically, the flow_hash variable should stay initialised to 0 in cake_hash() in pure host-based hashing mode. Add a check for this before using the skb->hash value as flow_hash. Fixes: b0c19ed ("sch_cake: Take advantage of skb->hash where appropriate") Reported-by: Pete Heist <[email protected]> Tested-by: Pete Heist <[email protected]> Signed-off-by: Toke Høiland-Jørgensen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1b80fec commit 86b9bbd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sched/sch_cake.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ static u32 cake_hash(struct cake_tin_data *q, const struct sk_buff *skb,
720720
skip_hash:
721721
if (flow_override)
722722
flow_hash = flow_override - 1;
723-
else if (use_skbhash)
723+
else if (use_skbhash && (flow_mode & CAKE_FLOW_FLOWS))
724724
flow_hash = skb->hash;
725725
if (host_override) {
726726
dsthost_hash = host_override - 1;

0 commit comments

Comments
 (0)