On Wed, Mar 22, 2023 at 12:17:55PM -0700, Maciej Żenczykowski wrote:
Could we please get: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i... 'net: retrieve netns cookie via getsocketopt'
included in 5.10 LTS.
This is technically a feature, but it's absolutely trivial - it just adds a new getsockopt to fetch a u64. Using netns cookies from bpf without it is pretty annoying.
This really is a new feature, why not just move to a new kernel version instead if you really need this?
It doesn't cherrypick to 5.10 cleanly, due to trivial conflicts in header files (previous constants haven't yet been defined), and because of a post 5.10 change from atomic64_t to u64 - which requires adding in an atomic_read(&).
I've uploaded a compiling version to: https://android-review.googlesource.com/c/kernel/common/+/2503056 I think you should be able to cherrypick it via: git fetch https://android.googlesource.com/kernel/common refs/changes/56/2503056/2 && git cherry-pick FETCH_HEAD
Please always submit a working backport here, we can't use random git commands for this type of thing, sorry. That way we can all properly review it and verify that you sent what you want us to apply.
thanks,
greg k-h