[Git][NTPsec/ntpsec][master] Implement unrestrict with address and no flags to remove a rule.

Eric S. Raymond gitlab at mg.gitlab.com
Thu Aug 17 01:10:33 UTC 2017


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
756d982e by Eric S. Raymond at 2017-08-16T21:09:56-04:00
Implement unrestrict with address and no flags to remove a rule.

- - - - -


1 changed file:

- ntpd/ntp_config.c


Changes:

=====================================
ntpd/ntp_config.c
=====================================
--- a/ntpd/ntp_config.c
+++ b/ntpd/ntp_config.c
@@ -1795,8 +1795,16 @@ config_access(
 		}
 
 		do {
-			int op = (my_node->mode == T_Restrict)
-				? RESTRICT_FLAGS : RESTRICT_UNFLAG;
+			int op;
+			if (my_node->mode == T_Restrict)
+				op = RESTRICT_FLAGS;
+			else if (my_node->mode == T_Unrestrict
+					&& flags == 0 && mflags == 0)
+				op = RESTRICT_REMOVE;
+			else if (my_node->mode == T_Unrestrict)
+				op = RESTRICT_UNFLAG;
+			else
+				continue;	/* should never happen */
 			hack_restrict(op, &addr,
 				      &mask, mflags, flags, 0);
 			if (pai != NULL &&



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/756d982e1087b350808f07754dbc4f4dcd440081

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/756d982e1087b350808f07754dbc4f4dcd440081
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/20170817/94f5e8e3/attachment.html>


More information about the vc mailing list