From 4884a6d13b191e6804a26fd066a6e8acd4fc1a48 Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Tue, 20 Jul 2021 23:16:46 +0200 Subject: [PATCH] cleaning up the code of the server --- src/server.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server.py b/src/server.py index 5e71939..28274e9 100644 --- a/src/server.py +++ b/src/server.py @@ -8,13 +8,13 @@ from configparser import ConfigParser from typing import List -from scapy.layers.dns import DNS, DNSQR, DNSRR, dnstypes -from scapy.layers.inet import IP, UDP +from scapy.layers.dns import DNSRR, dnstypes +from scapy.layers.inet import IP from scapy.sendrecv import send, sniff from converter import Content, Domain from packet import Packet -from utils import DNSAnswer, DNSHeaders, get_ip_from_hostname, init_logger +from utils import DNSAnswer, get_ip_from_hostname, init_logger def socket_server(ip: str): @@ -77,7 +77,7 @@ def _make_txt(self, packet: Packet) -> Packet: data = Domain.decode(subdomain) except binascii.Error: # couldn't decode, drop the packet and do nothing - logger.debug("Couldn't decode subdomain in %s", packet.qname) + self.logger.debug("Couldn't decode subdomain in %s", packet.qname) return return Packet.build_reply(