replace hard-coded queue ID with queried queue ID

pull/846/head
arctic-alpaca 2 months ago
parent dca68ae1ba
commit 5a85043fb1
No known key found for this signature in database
GPG Key ID: 5556CF6C310CFACD

@ -31,7 +31,9 @@ pub fn redirect_sock(ctx: XdpContext) -> u32 {
// Check whether incoming packet's queue ID matches the queue ID of the socket in XSKMAP at index `queue_id`.
if SOCKS.get(queue_id) == Some(queue_id) {
// Queue ID matches, redirect to AF_XDP socket.
SOCKS.redirect(0, 0).unwrap_or(xdp_action::XDP_ABORTED)
SOCKS
.redirect(queue_id, 0)
.unwrap_or(xdp_action::XDP_ABORTED)
} else {
// Queue ID did not match, pass packet to kernel network stack.
xdp_action::XDP_PASS

Loading…
Cancel
Save