summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2017-07-27 05:57:05 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2017-07-27 05:57:05 +0000
commit44b5a8c64b66c02ab260ec0f05ce56c7ab50a4c0 (patch)
treef70ee2efe846264a28e313793e5018f931c2984c /sys/net
parent4b83bd907ad10eb4460bef17a0648170ae5a907c (diff)
SEQ16_* macros weren't able to compare properly if one of the sequences is
wrapped around. Fix them to cast the proper width of integer when comparison. found goda@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/pipex_local.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/net/pipex_local.h b/sys/net/pipex_local.h
index 876eda21e57..218a9b71ba3 100644
--- a/sys/net/pipex_local.h
+++ b/sys/net/pipex_local.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pipex_local.h,v 1.28 2017/05/28 21:57:19 mlarkin Exp $ */
+/* $OpenBSD: pipex_local.h,v 1.29 2017/07/27 05:57:04 yasuoka Exp $ */
/*
* Copyright (c) 2009 Internet Initiative Japan Inc.
@@ -336,16 +336,16 @@ extern struct pipex_hash_head pipex_id_hashtable[];
}
#define PIPEX_SEEK_NEXTHDR(ptr, len, t) \
((t) (((char *)ptr) + len))
-#define SEQ32_LT(a,b) ((int)((a) - (b)) < 0)
-#define SEQ32_LE(a,b) ((int)((a) - (b)) <= 0)
-#define SEQ32_GT(a,b) ((int)((a) - (b)) > 0)
-#define SEQ32_GE(a,b) ((int)((a) - (b)) >= 0)
+#define SEQ32_LT(a,b) ((int32_t)((a) - (b)) < 0)
+#define SEQ32_LE(a,b) ((int32_t)((a) - (b)) <= 0)
+#define SEQ32_GT(a,b) ((int32_t)((a) - (b)) > 0)
+#define SEQ32_GE(a,b) ((int32_t)((a) - (b)) >= 0)
#define SEQ32_SUB(a,b) ((int32_t)((a) - (b)))
-#define SEQ16_LT(a,b) ((int)((a) - (b)) < 0)
-#define SEQ16_LE(a,b) ((int)((a) - (b)) <= 0)
-#define SEQ16_GT(a,b) ((int)((a) - (b)) > 0)
-#define SEQ16_GE(a,b) ((int)((a) - (b)) >= 0)
+#define SEQ16_LT(a,b) ((int16_t)((a) - (b)) < 0)
+#define SEQ16_LE(a,b) ((int16_t)((a) - (b)) <= 0)
+#define SEQ16_GT(a,b) ((int16_t)((a) - (b)) > 0)
+#define SEQ16_GE(a,b) ((int16_t)((a) - (b)) >= 0)
#define SEQ16_SUB(a,b) ((int16_t)((a) - (b)))
#define pipex_session_is_acfc_accepted(s) \