]> 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>
Sat, 16 Mar 2024 05:07:55 +0000 (16:07 +1100)
This is consistent with +dnssec and +nsid which only re-enable
EDNS if do is set to 1 or nsid is requested.

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

index 291490b741748e6590ca4b336ea3bf74f712311d..c98fa882775d5f8a99a824c74786da9363802f81 100644 (file)
@@ -1797,6 +1797,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 c1ac42978eb652471519ce4c442b1ce593ab93fc..0270edb31b5a8eaf9d24f8e9b13580abafb4c533 100644 (file)
@@ -1354,6 +1354,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':