diff options
| author | Bob Halley <halley@dnspython.org> | 2020-07-20 19:52:20 -0700 |
|---|---|---|
| committer | Bob Halley <halley@dnspython.org> | 2020-07-20 19:52:20 -0700 |
| commit | 58a404ab191241fd9f1237b674e44aca554da202 (patch) | |
| tree | a77f4948ad792354d1191fc49fb9f614fda56613 /dns/message.py | |
| parent | 0e87e17609be89b39f287d8950ae3693ed369bc9 (diff) | |
| download | dnspython-58a404ab191241fd9f1237b674e44aca554da202.tar.gz | |
Set EDNS default payload to 1232.
Diffstat (limited to 'dns/message.py')
| -rw-r--r-- | dns/message.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/dns/message.py b/dns/message.py index 2c7c735..7f66572 100644 --- a/dns/message.py +++ b/dns/message.py @@ -93,6 +93,7 @@ class MessageSection(dns.enum.IntEnum): globals().update(MessageSection.__members__) +DEFAULT_EDNS_PAYLOAD = 1232 class Message: """A DNS message.""" @@ -545,13 +546,13 @@ class Message: return bool(self.tsig) @staticmethod - def _make_opt(flags=0, payload=1280, options=None): + def _make_opt(flags=0, payload=DEFAULT_EDNS_PAYLOAD, options=None): opt = dns.rdtypes.ANY.OPT.OPT(payload, dns.rdatatype.OPT, options or ()) return dns.rrset.from_rdata(dns.name.root, int(flags), opt) - def use_edns(self, edns=0, ednsflags=0, payload=1280, request_payload=None, - options=None): + def use_edns(self, edns=0, ednsflags=0, payload=DEFAULT_EDNS_PAYLOAD, + request_payload=None, options=None): """Configure EDNS behavior. *edns*, an ``int``, is the EDNS level to use. Specifying |
