summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_cluster.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2019-12-05 13:36:31 +0100
committerPhil Sutter <phil@nwl.cc>2019-12-06 12:12:08 +0100
commit28c16371cdad16707674450b59919e3d97185694 (patch)
tree9b1ef8c86b84af4955ba96af9accfea71dc78f79 /extensions/libxt_cluster.c
parent98b221002960040bf3505811c06025b6b9b6984b (diff)
extensions: cluster: Avoid undefined shift
Value 1 is signed by default and left-shifting by 31 is undefined for those. Fix this by marking the value as unsigned. Fixes: 64a0e09894e52 ("extensions: libxt_cluster: Add translation to nft")
Diffstat (limited to 'extensions/libxt_cluster.c')
-rw-r--r--extensions/libxt_cluster.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/extensions/libxt_cluster.c b/extensions/libxt_cluster.c
index c9c35ee2..d164bf69 100644
--- a/extensions/libxt_cluster.c
+++ b/extensions/libxt_cluster.c
@@ -156,7 +156,7 @@ static int cluster_xlate(struct xt_xlate *xl,
xt_xlate_add(xl, "%s %u seed 0x%08x ", jhash_st,
info->total_nodes, info->hash_seed);
for (node = 0; node < 32; node++) {
- if (info->node_mask & (1 << node)) {
+ if (info->node_mask & (1u << node)) {
if (needs_set == 0) {
xt_xlate_add(xl, "{ ");
needs_set = 1;