Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpf: Derive host netns cookie via SO_NETNS_COOKIE #17018

Merged
merged 1 commit into from
Aug 3, 2021

Commits on Aug 3, 2021

  1. bpf: Derive host netns cookie via SO_NETNS_COOKIE

    When running in nested environments (e.g. Kind), cilium-agent does not
    run in the host netns. So, in such cases the cookie comparison based on
    bpf_get_netns_cookie(NULL) in bpf_sock.c for checking whether a socket
    belongs to a host netns does not work. This breaks some socket-lb
    functionality.
    
    To fix this, we derive the cookie of the netns in which cilium-agent
    runs via getsockopt(...SO_NETNS_COOKIE...) and then use it in the check
    above. This is based on an assumption that cilium-agent always runs with
    "hostNetwork: true".
    
    Signed-off-by: Martynas Pumputis <m@lambda.lt>
    brb committed Aug 3, 2021
    Configuration menu
    Copy the full SHA
    d612829 View commit details
    Browse the repository at this point in the history