Skip to content

Commit

Permalink
apps.xdp: generate more descriptive errors on bind(2) failure
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeneia committed Nov 18, 2019
1 parent 22d754c commit 4e31856
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/apps/xdp/xdp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,11 @@ function XDP:create_xsk (ifname, queue)
-- flags = bits{ XDP_ZEROCOPY=2 }
}
)
assert(xsk.sock:bind(sa, ffi.sizeof(sa)))
local ok, err = xsk.sock:bind(sa, ffi.sizeof(sa))
if not ok then
error(("Unable to bind AF_XDP socket to %s queue %d (%s)")
:format(ifname, queue, err))
end
return xsk
end

Expand Down

0 comments on commit 4e31856

Please sign in to comment.