NICMx / Jool

SIIT and NAT64 for Linux
GNU General Public License v2.0
328 stars 66 forks source link

fix: build on v6.6+ kernel #415

Closed iam-TJ closed 1 year ago

iam-TJ commented 1 year ago

Commit bffcc6882a "genetlink: remove userhdr from struct genl_info" caused the build to fail since the field no longer exists.

Replace with run-time calculation of the header offset.

ydahhrk commented 1 year ago

I'm sorry for the silence. I'll review and likely merge next Saturday.

ydahhrk commented 1 year ago

Hmm. Ok, but it seems the new formal way to access the header is through genl_info_userhdr(), not by manual pointer manipulation.

(Notes moved to the review)

ydahhrk commented 1 year ago

Note, we have helper macros to define code that should be compiled differently depending on linked kernel version. Sample usage.

runborg commented 1 year ago

As a note, there is a patch from canonical/ubuntu for this: https://git.launchpad.net/ubuntu/+source/jool/tree/debian/patches/0002-Linux-6.6-support.patch?h=applied/ubuntu/devel

ydahhrk commented 1 year ago

Just to be clear: I'm waiting for a patch because I think it's rude to overwrite people's contributions. (Though admittedly I've done it in the past.)

I'll wait until Saturday. Alternatively, if you just want me to push the fix ASAP, just say so.

iam-TJ commented 1 year ago

I've been away for a few days; thanks for the review. Looking at it now I'm not quite sure what I was thinking but assume I copied from genl_info_userhdr() but replaced the u8 * cast rather than adding the additional cast.

Maybe the Canonical patch makes more sense since it makes clear that internal kernel structure changed at version 6.6.

ydahhrk commented 2 months ago

@microcai How about this?

microcai commented 2 months ago

@ydahhrk this one is nice !