]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
add strict bound check tests
authorColin Vidal <colin@isc.org>
Wed, 19 Nov 2025 11:33:52 +0000 (12:33 +0100)
committerEvan Hunt <each@isc.org>
Wed, 7 Jan 2026 07:01:59 +0000 (07:01 +0000)
Add checkconf system test covering the strict boundary checks for
`edns-version`, `edns-udp-size`, `max-udp-size`, `no-cookie-udp-size`
and `padding`.

14 files changed:
bin/tests/system/checkconf/bad-edns-udp-size-options.conf [new file with mode: 0644]
bin/tests/system/checkconf/bad-edns-udp-size-server.conf [new file with mode: 0644]
bin/tests/system/checkconf/bad-edns-udp-size-view-server.conf [new file with mode: 0644]
bin/tests/system/checkconf/bad-edns-udp-size-view.conf [new file with mode: 0644]
bin/tests/system/checkconf/bad-edns-version-server.conf [new file with mode: 0644]
bin/tests/system/checkconf/bad-edns-version-view-server.conf [new file with mode: 0644]
bin/tests/system/checkconf/bad-max-udp-size-options.conf [new file with mode: 0644]
bin/tests/system/checkconf/bad-max-udp-size-server.conf [new file with mode: 0644]
bin/tests/system/checkconf/bad-max-udp-size-view-server.conf [new file with mode: 0644]
bin/tests/system/checkconf/bad-max-udp-size-view.conf [new file with mode: 0644]
bin/tests/system/checkconf/bad-nocookie-udp-size-options.conf [new file with mode: 0644]
bin/tests/system/checkconf/bad-nocookie-udp-size-view.conf [new file with mode: 0644]
bin/tests/system/checkconf/bad-padding-server.conf [new file with mode: 0644]
bin/tests/system/checkconf/bad-padding-view-server.conf [new file with mode: 0644]

diff --git a/bin/tests/system/checkconf/bad-edns-udp-size-options.conf b/bin/tests/system/checkconf/bad-edns-udp-size-options.conf
new file mode 100644 (file)
index 0000000..308a3c4
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+options {
+       edns-udp-size 4097;
+};
diff --git a/bin/tests/system/checkconf/bad-edns-udp-size-server.conf b/bin/tests/system/checkconf/bad-edns-udp-size-server.conf
new file mode 100644 (file)
index 0000000..a77797d
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+server 1.2.3.4 {
+       edns-udp-size 511;
+};
diff --git a/bin/tests/system/checkconf/bad-edns-udp-size-view-server.conf b/bin/tests/system/checkconf/bad-edns-udp-size-view-server.conf
new file mode 100644 (file)
index 0000000..88657b3
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+view foo {
+       server 10.11.12.13 {
+               edns-udp-size 13;
+       };
+};
diff --git a/bin/tests/system/checkconf/bad-edns-udp-size-view.conf b/bin/tests/system/checkconf/bad-edns-udp-size-view.conf
new file mode 100644 (file)
index 0000000..18e653c
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+view foo {
+       edns-udp-size 4097;
+};
diff --git a/bin/tests/system/checkconf/bad-edns-version-server.conf b/bin/tests/system/checkconf/bad-edns-version-server.conf
new file mode 100644 (file)
index 0000000..709ebdd
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+server 1.2.3.4 {
+       edns-version 256;
+};
diff --git a/bin/tests/system/checkconf/bad-edns-version-view-server.conf b/bin/tests/system/checkconf/bad-edns-version-view-server.conf
new file mode 100644 (file)
index 0000000..1a0f32a
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+view foo {
+       server 10.11.12.13 {
+               edns-version 257;
+       };
+};
diff --git a/bin/tests/system/checkconf/bad-max-udp-size-options.conf b/bin/tests/system/checkconf/bad-max-udp-size-options.conf
new file mode 100644 (file)
index 0000000..bbde2d7
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+options {
+       max-udp-size 4097;
+};
diff --git a/bin/tests/system/checkconf/bad-max-udp-size-server.conf b/bin/tests/system/checkconf/bad-max-udp-size-server.conf
new file mode 100644 (file)
index 0000000..efea47e
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+server 1.2.3.4 {
+       max-udp-size 511;
+};
diff --git a/bin/tests/system/checkconf/bad-max-udp-size-view-server.conf b/bin/tests/system/checkconf/bad-max-udp-size-view-server.conf
new file mode 100644 (file)
index 0000000..8cf72bd
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+view foo {
+       server 10.11.12.13 {
+               max-udp-size 13;
+       };
+};
diff --git a/bin/tests/system/checkconf/bad-max-udp-size-view.conf b/bin/tests/system/checkconf/bad-max-udp-size-view.conf
new file mode 100644 (file)
index 0000000..8da68c6
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+view foo {
+       max-udp-size 4097;
+};
diff --git a/bin/tests/system/checkconf/bad-nocookie-udp-size-options.conf b/bin/tests/system/checkconf/bad-nocookie-udp-size-options.conf
new file mode 100644 (file)
index 0000000..e230553
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+options {
+       nocookie-udp-size 127;
+};
diff --git a/bin/tests/system/checkconf/bad-nocookie-udp-size-view.conf b/bin/tests/system/checkconf/bad-nocookie-udp-size-view.conf
new file mode 100644 (file)
index 0000000..58cc2fd
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+view foo {
+       nocookie-udp-size 127;
+};
diff --git a/bin/tests/system/checkconf/bad-padding-server.conf b/bin/tests/system/checkconf/bad-padding-server.conf
new file mode 100644 (file)
index 0000000..0bcb147
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+server 1.2.3.4 {
+       padding 513;
+};
diff --git a/bin/tests/system/checkconf/bad-padding-view-server.conf b/bin/tests/system/checkconf/bad-padding-view-server.conf
new file mode 100644 (file)
index 0000000..967abcd
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+view foo {
+       server 10.11.12.13 {
+               padding 2345;
+       };
+};