]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rgw/rgw_iam_policy.h
update sources to v12.2.3
[ceph.git] / ceph / src / rgw / rgw_iam_policy.h
index 59117456e0cc4a11c59213e29f7f37fe8fc9146d..032840151a6ff083a2c6015d8127d306f6d0a201 100644 (file)
@@ -250,8 +250,9 @@ std::ostream& operator <<(std::ostream& m, const MaskedIP& ip);
 string to_string(const MaskedIP& m);
 
 inline bool operator ==(const MaskedIP& l, const MaskedIP& r) {
-  auto shift = std::max((l.v6 ? 128 : 32) - l.prefix,
-                       (r.v6 ? 128 : 32) - r.prefix);
+  auto shift = std::max((l.v6 ? 128 : 32) - ((int) l.prefix),
+                       (r.v6 ? 128 : 32) - ((int) r.prefix));
+  ceph_assert(shift >= 0);
   return (l.addr >> shift) == (r.addr >> shift);
 }