kxdpgun couldn't customize .edns_size
I found that kxdpgun couldn't customize the .edns_size when I use it to test server with DNSSEC. It was fixed to the value 1232 in line:145 of src/utils/kxdpgun/main.c
I have tried to add one option '-e <udp_payload_size>', it could send the query as expected and handle the response where the data section is less than 1480 bytes, but couldn't regonize the response more than 1480.
The referece code is:
[root@localhost kxdpgun]# diff -Naur main.c_20240111 main.c
--- main.c_20240111 2023-12-13 14:21:33.000000000 +0800
+++ main.c 2024-01-11 09:49:05.000000000 +0800
@@ -1111,6 +1111,7 @@
" -v, --vlan <id> "SPACE"Add VLAN 802.1Q header with the given id.\n"
" -m, --mode <mode> "SPACE"Set XDP mode (auto, copy, generic).\n"
" -G, --qlog <path> "SPACE"Output directory for qlog (useful for QUIC only).\n"
+ " -e, --edns-size "SPACE"UDP payload size, default is 1232, range 513-4096\n"
" -h, --help "SPACE"Print the program help.\n"
" -V, --version "SPACE"Print the program version.\n"
"\n"
@@ -1230,6 +1231,7 @@
{ "remote-mac", required_argument, NULL, 'R' },
{ "vlan", required_argument, NULL, 'v' },
{ "mode", required_argument, NULL, 'm' },
+ { "edns-size", optional_argument, NULL, 'e' },
{ NULL }
};
@@ -1237,7 +1239,7 @@
bool default_at_once = true;
double argf;
char *argcp, *local_ip = NULL, *filename = NULL;
- while ((opt = getopt_long(argc, argv, "hVt:Q:b:rp:T::U::F:I:l:i:L:R:v:m:G:", opts, NULL)) != -1) {
+ while ((opt = getopt_long(argc, argv, "hVt:Q:b:rp:T::U::F:I:l:i:L:R:v:m:G:e:", opts, NULL)) != -1) {
switch (opt) {
case 'h':
print_help();
@@ -1375,6 +1377,16 @@
return false;
}
break;
+ case 'e':
+ assert(optarg);
+ arg = atoi(optarg);
+ if (arg > 512 && arg <= 4096) {
+ ctx->edns_size = arg;
+ } else {
+ ERR2("invalid edns size '%s'", optarg);
+ return false;
+ }
+ break;
default:
print_help();
return false;