Fix assert issue in ip_csum_add_even()
[vpp.git] / src / vnet / ip / ip_packet.h
index 3c532f1..6c86e3e 100644 (file)
@@ -107,7 +107,8 @@ ip_csum_add_even (ip_csum_t c, ip_csum_t x)
   /* Fold in carry from high bit. */
   d -= d > c;
 
-  ASSERT (ip_csum_with_carry (d, x) == c);
+  ip_csum_t t = ip_csum_with_carry (d, x);
+  ASSERT ((t - c == 0) || (t - c == ~0));
 
   return d;
 }