Skip to content

Commit 57a30fb

Browse files
committed
Fix compilation error on CentOS 8 (kernel-4.18.0-227)
Error message: ipt_NETFLOW.c: In function ‘ipt_netflow_fini’: ipt_NETFLOW.c:5789:2: error: implicit declaration of function ‘synchronize_sched’; did you mean ‘synchronize_net’? [-Werror=implicit-function-declaration] synchronize_sched(); ^~~~~~~~~~~~~~~~~ synchronize_net cc1: some warnings being treated as errors
1 parent 653a52a commit 57a30fb

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

gen_compat_def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ kbuild_test_struct timeval linux/ktime.h
7777
# 97a32539b9568 proc: convert everything to "struct proc_ops"
7878
# d56c0d45f0e27 proc: decouple proc from VFS with "struct proc_ops"
7979
kbuild_test_struct proc_ops linux/proc_fs.h
80+
# No since v5.1, but present in CentOS-8's 4.18.0-227
81+
kbuild_test_symbol synchronize_sched linux/rcupdate.h
8082

8183
echo "// End of compat_def.h"
8284

ipt_NETFLOW.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5785,7 +5785,7 @@ static void __exit ipt_netflow_fini(void)
57855785
netflow_scan_and_export(AND_FLUSH);
57865786
del_timer_sync(&rate_timer);
57875787

5788-
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,1,0)
5788+
#ifdef HAVE_SYNCHRONIZE_SCHED
57895789
synchronize_sched();
57905790
#else
57915791
synchronize_rcu();

0 commit comments

Comments
 (0)