Commit db8353b2 authored by Gary Lin's avatar Gary Lin Committed by Brenden Blanco

libbpf: fix typo in bpf_attach_xdp()

parent f72909f1
...@@ -781,7 +781,7 @@ int bpf_attach_xdp(const char *dev_name, int progfd, uint32_t flags) { ...@@ -781,7 +781,7 @@ int bpf_attach_xdp(const char *dev_name, int progfd, uint32_t flags) {
// parse flags as passed by the user // parse flags as passed by the user
if (flags) { if (flags) {
nla_xdp = (struct nlattr *)((char *)nla + nla->nla_len); nla_xdp = (struct nlattr *)((char *)nla + nla->nla_len);
nla_xdp->nla_type = 3/*IFLA_XDP_SKB*/; nla_xdp->nla_type = 3/*IFLA_XDP_FLAGS*/;
nla_xdp->nla_len = NLA_HDRLEN + sizeof(flags); nla_xdp->nla_len = NLA_HDRLEN + sizeof(flags);
memcpy((char *)nla_xdp + NLA_HDRLEN, &flags, sizeof(flags)); memcpy((char *)nla_xdp + NLA_HDRLEN, &flags, sizeof(flags));
nla->nla_len += nla_xdp->nla_len; nla->nla_len += nla_xdp->nla_len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment