Bugfixes
--------
- modules/dns64: fix incorrect packet writes for cached packets (#727, !1275)
+- xdp: make it work also with libknot 3.1 (#735, !1276)
Knot Resolver 5.5.0 (2022-03-15)
return NULL;
}
*maxlen = MIN(*maxlen, out.payload.iov_len);
+#if KNOT_VERSION_HEX < 0x030100
/* It's most convenient to fill the MAC addresses at this point. */
memcpy(out.eth_from, &ctx->source.eth_addrs[0], 6);
memcpy(out.eth_to, &ctx->source.eth_addrs[1], 6);
+#endif
return out.payload.iov_base;
}
static void free_wire(const struct request_ctx *ctx)
return qr_task_on_send(task, src_handle, kr_error(EINVAL));
knot_xdp_msg_t msg;
+#if KNOT_VERSION_HEX >= 0x030100
+ /* We don't have a nice way of preserving the _msg_t from frame allocation,
+ * so we manually redo all other parts of knot_xdp_send_alloc() */
+ memset(&msg, 0, sizeof(msg));
+ bool ipv6 = ctx->source.addr.ip.sa_family == AF_INET6;
+ msg.flags = ipv6 ? KNOT_XDP_MSG_IPV6 : 0;
+ memcpy(msg.eth_from, &ctx->source.eth_addrs[0], 6);
+ memcpy(msg.eth_to, &ctx->source.eth_addrs[1], 6);
+#endif
const struct sockaddr *ip_from = &ctx->source.dst_addr.ip;
const struct sockaddr *ip_to = &ctx->source.comm_addr.ip;
memcpy(&msg.ip_from, ip_from, kr_sockaddr_len(ip_from));