From: Remi Gacogne Date: Mon, 15 Jan 2024 15:09:22 +0000 (+0100) Subject: xdp.py: The ports set is now unused in XSK mode X-Git-Tag: dnsdist-1.9.0-rc1^2~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39bbdd1b1e0761fe2d965f4b08b25a153b4bcfcc;p=thirdparty%2Fpdns.git xdp.py: The ports set is now unused in XSK mode --- diff --git a/contrib/xdp.py b/contrib/xdp.py index 67ad96b917..d6ef369708 100644 --- a/contrib/xdp.py +++ b/contrib/xdp.py @@ -13,7 +13,7 @@ ACTIONS = {1 : 'DROP', 2 : 'TC'} DROP_ACTION = 1 TC_ACTION = 2 -# The interface on wich the filter will be attached +# The interface on wich the filter will be attached DEV = "eth1" # The list of blocked IPv4, IPv6 and QNames @@ -28,12 +28,13 @@ blocked_qnames = [("localhost", "A", DROP_ACTION), ("test.com", "*", TC_ACTION)] # Main useXsk = True -Ports = [53] cflag = [] if useXsk: cflag.append("-DUseXsk") -IN_DNS_PORT_SET = "||".join("COMPARE_PORT((x),"+str(i)+")" for i in Ports) -cflag.append(r"-DIN_DNS_PORT_SET(x)=(" + IN_DNS_PORT_SET + r")") +else: + Ports = [53] + IN_DNS_PORT_SET = "||".join("COMPARE_PORT((x),"+str(i)+")" for i in Ports) + cflag.append(r"-DIN_DNS_PORT_SET(x)=(" + IN_DNS_PORT_SET + r")") xdp = BPF(src_file="xdp-filter.ebpf.src", cflags=cflag)