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

compiling against a vendor kernel for 5.4 resulted in an undeclared function #407

Closed
chardin-cpi opened this issue Jun 27, 2023 · 1 comment
Labels
Milestone

Comments

@chardin-cpi
Copy link

This is a vendor environment targeting an aarch64 platform with a gcc 11.2 and kernel close to 5.4.x kernel

# SPDX-License-Identifier: GPL-2.0
VERSION = 5
PATCHLEVEL = 4
SUBLEVEL = 70
EXTRAVERSION =
NAME = Kleptomaniac Octopus

and then building the jool kernel module

  CC [M]  /home/ubuntu/build/jool-4.1.10/src/mod/common/rfc7915/6to4.o
../jool-4.1.10/src/mod/common/rfc7915/6to4.c: In function 'update_icmp4_csum':
../jool-4.1.10/src/mod/common/rfc7915/6to4.c:825:28: error: implicit declaration of function 'csum_ipv6_magic'; did you mean 'csum_tcpudp_magic'? [-Werror=implicit-function-declaration]
  825 |         tmp = ~csum_unfold(csum_ipv6_magic(&in_ip6->saddr, &in_ip6->daddr,
      |                            ^~~~~~~~~~~~~~~
      |                            csum_tcpudp_magic
cc1: some warnings being treated as errors

So, resolved this with this patch that seems to work on all of the platforms targeted with arm and aarch64

diff -Naur Jool-4.1.10.orig/src/mod/common/rfc7915/6to4.c Jool-4.1.10/src/mod/common/rfc7915/6to4.c
--- Jool-4.1.10.orig/src/mod/common/rfc7915/6to4.c      2023-06-11 11:24:56.000000000 -0700
+++ Jool-4.1.10/src/mod/common/rfc7915/6to4.c   2023-06-26 15:47:09.573363699 -0700
@@ -1,6 +1,7 @@
 #include "mod/common/rfc7915/6to4.h"
 
 #include <linux/inetdevice.h>
+#include <net/ip6_checksum.h>
 #include <net/udp.h>
 #include <net/tcp.h>

This might be a problem in a linux tree - but, the patch seemed benign enough to report upstream.

@chardin-cpi chardin-cpi changed the title compiling against a vendor kernel for 5.15 resulted in an undeclared function compiling against a vendor kernel for 5.4 resulted in an undeclared function Jun 27, 2023
@ydahhrk ydahhrk closed this as completed in aa511f8 Jul 1, 2023
@ydahhrk
Copy link
Member

ydahhrk commented Jul 1, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants