Commit d71dbdaa authored by Arnd Bergmann's avatar Arnd Bergmann Committed by David S. Miller

bpfilter: fix building without CONFIG_INET

bpfilter_process_sockopt is a callback that gets called from
ip_setsockopt() and ip_getsockopt(). However, when CONFIG_INET is
disabled, it never gets called at all, and assigning a function to the
callback pointer results in a link failure:

net/bpfilter/bpfilter_kern.o: In function `__stop_umh':
bpfilter_kern.c:(.text.unlikely+0x3): undefined reference to `bpfilter_process_sockopt'
net/bpfilter/bpfilter_kern.o: In function `load_umh':
bpfilter_kern.c:(.init.text+0x73): undefined reference to `bpfilter_process_sockopt'

Since there is no caller in this configuration, I assume we can
simply make the assignment conditional.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f0332962
...@@ -33,7 +33,8 @@ static void shutdown_umh(struct umh_info *info) ...@@ -33,7 +33,8 @@ static void shutdown_umh(struct umh_info *info)
static void __stop_umh(void) static void __stop_umh(void)
{ {
if (bpfilter_process_sockopt) { if (IS_ENABLED(CONFIG_INET) &&
bpfilter_process_sockopt) {
bpfilter_process_sockopt = NULL; bpfilter_process_sockopt = NULL;
shutdown_umh(&info); shutdown_umh(&info);
} }
...@@ -98,7 +99,9 @@ static int __init load_umh(void) ...@@ -98,7 +99,9 @@ static int __init load_umh(void)
stop_umh(); stop_umh();
return -EFAULT; return -EFAULT;
} }
if (IS_ENABLED(CONFIG_INET))
bpfilter_process_sockopt = &__bpfilter_process_sockopt; bpfilter_process_sockopt = &__bpfilter_process_sockopt;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment