| 946 | # pylint: enable=unused-argument |
| 947 | |
| 948 | def _parse_special_rr_header(self, section, count, position, name, rdclass, rdtype): |
| 949 | if rdtype == dns.rdatatype.OPT: |
| 950 | if ( |
| 951 | section != MessageSection.ADDITIONAL |
| 952 | or self.opt |
| 953 | or name != dns.name.root |
| 954 | ): |
| 955 | raise BadEDNS |
| 956 | elif rdtype == dns.rdatatype.TSIG: |
| 957 | if ( |
| 958 | section != MessageSection.ADDITIONAL |
| 959 | or rdclass != dns.rdatatype.ANY |
| 960 | or position != count - 1 |
| 961 | ): |
| 962 | raise BadTSIG |
| 963 | return (rdclass, rdtype, None, False) |
| 964 | |
| 965 | |
| 966 | class ChainingResult: |