[Git][NTPsec/ntpsec][master] 3 commits: Minor cleanups to restrict
Hal Murray (@hal.murray)
gitlab at mg.gitlab.com
Thu Jul 6 01:50:18 UTC 2023
Hal Murray pushed to branch master at NTPsec / ntpsec
Commits:
60b11cbb by Hal Murray at 2023-07-04T15:27:55-07:00
Minor cleanups to restrict
Drop RES_FLAGS, not used
restrict hitcount => 64 bits
Add a few comments
- - - - -
e20897c3 by Hal Murray at 2023-07-04T15:27:55-07:00
Fix for Coverity CID 462307
- - - - -
418c338e by Hal Murray at 2023-07-04T15:27:55-07:00
Squash warnings about not handled enumeration
- - - - -
4 changed files:
- include/ntp.h
- libntp/pymodule-mac.c
- ntpd/ntp_restrict.c
- tests/unity/unity.c
Changes:
=====================================
include/ntp.h
=====================================
@@ -670,7 +670,7 @@ typedef struct res_addr6_tag {
typedef struct restrict_u_tag restrict_u;
struct restrict_u_tag {
restrict_u * link; /* link to next entry */
- uint32_t hitcount; /* number of packets matched */
+ uint64_t hitcount; /* number of packets matched */
unsigned short flags; /* accesslist flags */
unsigned short mflags; /* match flags */
union { /* variant starting here */
@@ -695,8 +695,6 @@ struct restrict_u_tag {
#define RES_VERSION 0x0008 /* version mismatch */
#define RES_NOPEERx 0x0010 /* new association denied */
#define RES_LIMITED 0x0020 /* packet rate exceeded */
-#define RES_FLAGS (RES_IGNORE | RES_DONTSERVE | RES_DONTTRUST | \
- RES_VERSION | RES_LIMITED)
#define RES_NOQUERY 0x0040 /* mode 6 packet denied */
#define RES_NOMODIFY 0x0080 /* mode 6 modify denied */
@@ -708,7 +706,7 @@ struct restrict_u_tag {
#define RES_FLAKE 0x1000 /* flakeway - drop 10% */
#define RES_NOMRULIST 0x2000 /* mode 6 mrulist denied */
-/* RES_DEFAULT defined in resolv.h */
+/* RES_DEFAULT defined in /usr/include/resolv.h */
#define RES_Default (RES_NOQUERY|RES_LIMITED)
/* pythonize-header: start ignoring */
=====================================
libntp/pymodule-mac.c
=====================================
@@ -143,6 +143,10 @@ void do_mac(char *name,
*maclen = 0;
return;
}
+ /* Coverity CID 462307, 2023 June 11
+ * CMAC API is undocumented and deprecated in OpenSSL 3.
+ * See libntp/macencrypt.c */
+ /* coverity[checked_return] */
CMAC_Update(cmac_ctx, data, (unsigned int)datalen);
CMAC_Final(cmac_ctx, mac, maclen);
if (MAX_MAC_LENGTH < *maclen)
=====================================
ntpd/ntp_restrict.c
=====================================
@@ -160,8 +160,8 @@ init_restrict(void)
restrict_def4.flags = RES_Default;
restrict_def6.flags = RES_Default;
if (RES_Default & RES_LIMITED) {
- inc_res_limited();
- inc_res_limited();
+ inc_res_limited(); /* IPv4 */
+ inc_res_limited(); /* IPv6 */
}
restrictcount = 2;
}
=====================================
tests/unity/unity.c
=====================================
@@ -1002,6 +1002,7 @@ void UnityAssertFloatSpecial(const UNITY_FLOAT actual,
is_trait = !isinf(actual) && !isnan(actual);
break;
+ case UNITY_FLOAT_INVALID_TRAIT: /* Supress warning */
default: /* including UNITY_FLOAT_INVALID_TRAIT */
trait_index = 0;
trait_names[0] = UnityStrInvalidFloatTrait;
@@ -1142,6 +1143,7 @@ void UnityAssertDoubleSpecial(const UNITY_DOUBLE actual,
is_trait = !isinf(actual) && !isnan(actual);
break;
+ case UNITY_FLOAT_INVALID_TRAIT: /* Supress warning */
default: /* including UNITY_FLOAT_INVALID_TRAIT */
trait_index = 0;
trait_names[0] = UnityStrInvalidFloatTrait;
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/compare/f93137759ee5fc9925cf0ec51fba4b0773a69e34...418c338e38d1ff04b128667fc1678c07f4059b77
--
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/compare/f93137759ee5fc9925cf0ec51fba4b0773a69e34...418c338e38d1ff04b128667fc1678c07f4059b77
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20230706/f8b57d74/attachment-0001.htm>
More information about the vc
mailing list