'max_port' is 16bit field, shift expands it to 'int', not unsigned int.

 lib/conntrack.c:2245:41: runtime error:
   left shift of 34568 by 16 places cannot be represented in type 'int'.

     0 0xec45f4 in nat_range_hash lib/conntrack.c:2245:41
     1 0xec45f4 in nat_get_unique_tuple lib/conntrack.c:2422:21
     2 0xec45f4 in conn_not_found lib/conntrack.c:1035:32
     3 0xeaf0a5 in process_one lib/conntrack.c:1407:20
     4 0xea9390 in conntrack_execute lib/conntrack.c:1465:13
     5 0x839530 in dp_execute_cb lib/dpif-netdev.c:9060:9
     6 0x9909cc in odp_execute_actions lib/odp-execute.c:868:17
     7 0x830946 in dp_netdev_execute_actions lib/dpif-netdev.c:9106:5
     8 0x830946 in handle_packet_upcall lib/dpif-netdev.c:8294:5
     9 0x82ea5e in fast_path_processing lib/dpif-netdev.c:8390:25
     10 0x7ed87f in dp_netdev_input__ lib/dpif-netdev.c:8479:9
     11 0x7eb5fc in dp_netdev_input lib/dpif-netdev.c:8517:5
     12 0x81dada in dp_netdev_process_rxq_port lib/dpif-netdev.c:5329:19
     13 0x7f0063 in dpif_netdev_run lib/dpif-netdev.c:6664:25
     14 0x85f036 in dpif_run lib/dpif.c:467:16
     15 0x61833a in type_run ofproto/ofproto-dpif.c:366:9
     16 0x5c210e in ofproto_type_run ofproto/ofproto.c:1822:31
     17 0x565db2 in bridge_run__ vswitchd/bridge.c:3245:9
     18 0x562f82 in bridge_run vswitchd/bridge.c:3310:5
     19 0x59a98c in main vswitchd/ovs-vswitchd.c:129:9
     20 0x7f8864c3acf2 in __libc_start_main (/lib64/libc.so.6+0x3acf2)
     21 0x47e60d in _start (vswitchd/ovs-vswitchd+0x47e60d)

Fixes: 92edd073ce6c ("conntrack: Hash entire NAT data structure in 
nat_range_hash().")
Signed-off-by: Ilya Maximets <[email protected]>
---
 lib/conntrack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/conntrack.c b/lib/conntrack.c
index b243370d0..faa2d6ab7 100644
--- a/lib/conntrack.c
+++ b/lib/conntrack.c
@@ -2242,7 +2242,7 @@ nat_range_hash(const struct conn *conn, uint32_t basis,
     hash = ct_addr_hash_add(hash, &nat_info->min_addr);
     hash = ct_addr_hash_add(hash, &nat_info->max_addr);
     hash = hash_add(hash,
-                    (nat_info->max_port << 16)
+                    ((uint32_t) nat_info->max_port << 16)
                     | nat_info->min_port);
     hash = ct_endpoint_hash_add(hash, &conn->key.src);
     hash = ct_endpoint_hash_add(hash, &conn->key.dst);
-- 
2.34.3

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to