]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Re-enable EDNS if an EDNS flag gets set to 1 by +ednsflags
authorMark Andrews <marka@isc.org>
Sat, 16 Mar 2024 04:55:37 +0000 (15:55 +1100)
committerMark Andrews <marka@isc.org>
Sun, 17 Mar 2024 03:11:51 +0000 (13:11 +1000)
This is consistent with +dnssec and +nsid which only re-enable
EDNS if do is set to 1 or nsid is requested.

(cherry picked from commit d74bba4fae2314818ac509088cd182d843d6b36a)

bin/dig/dig.c
bin/tools/mdig.c

index 87552be6f6cb2e797dc68b897923b71e3256e9b3..74900f4c29f666f9b9fbf6591e6853128f395877 100644 (file)
@@ -1453,6 +1453,10 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
                                                             "ednsflags");
                                                        goto exit_or_usage;
                                                }
+                                               if (lookup->edns == -1) {
+                                                       lookup->edns =
+                                                               DEFAULT_EDNS_VERSION;
+                                               }
                                                lookup->ednsflags = num;
                                                break;
                                        case 'n':
index ae3fd862e58e2c3927df60b4030c688a56802806..d935524b6c06cbd0b67db993e447c349871fe6d0 100644 (file)
@@ -1366,6 +1366,9 @@ plus_option(char *option, struct query *query, bool global) {
                                                        "ednsflags");
                                                CHECK("parse_xint(ednsflags)",
                                                      result);
+                                               if (query->edns == -1) {
+                                                       query->edns = 1;
+                                               }
                                                query->ednsflags = num;
                                                break;
                                        case 'o':