apernet / tcp-brutal

GNU General Public License v3.0
654 stars 70 forks source link

内核模块在 linux 6.10.1 上编译失败 #22

Closed love4taylor closed 3 months ago

love4taylor commented 3 months ago
  CC      net/ipv4/tcp_brutal.o
/home/runner/work/linux-self-use-deb/linux-self-use-deb/linux-6.10.1/net/ipv4/tcp_brutal.c:38:5: warning: no previous prototype for function 'tcp_sock_get_sec' [-Wmissing-prototypes]
   38 | u64 tcp_sock_get_sec(const struct tcp_sock *tp)
      |     ^
/home/runner/work/linux-self-use-deb/linux-self-use-deb/linux-6.10.1/net/ipv4/tcp_brutal.c:38:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   38 | u64 tcp_sock_get_sec(const struct tcp_sock *tp)
      | ^
      | static 
/home/runner/work/linux-self-use-deb/linux-self-use-deb/linux-6.10.1/net/ipv4/tcp_brutal.c:280:21: error: incompatible function pointer types initializing 'void (*)(struct sock *, u32, int, const struct rate_sample *)' (aka 'void (*)(struct sock *, unsigned int, int, const struct rate_sample *)') with an expression of type 'void (struct sock *, const struct rate_sample *)' [-Wincompatible-function-pointer-types]
  280 |     .cong_control = brutal_main,
      |                     ^~~~~~~~~~~
1 warning and 1 error generated.
haruue commented 3 months ago

https://github.com/torvalds/linux/commit/57bfc7605ca5b102ba336779ae9adbc5bbba1d96

看起来我们也加上这两个参数就好了, 不用做额外的处理