Commit 7c6090ee authored by Wang Hai's avatar Wang Hai Committed by Andrii Nakryiko

samples/bpf: Fix the error return code of xdp_redirect's main()

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

If bpf_map_update_elem() failed, main() should return a negative error.

Fixes: 832622e6 ("xdp: sample program for new bpf_redirect helper")
Signed-off-by: default avatarWang Hai <wanghai38@huawei.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210616042534.315097-1-wanghai38@huawei.com
parent 85102ba5
......@@ -213,5 +213,5 @@ int main(int argc, char **argv)
poll_stats(2, ifindex_out);
out:
return 0;
return ret;
}
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