diff options
author | Arnd Bergmann <arnd@arndb.de> | 2018-05-29 11:55:06 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-05-29 08:13:35 -0400 |
commit | d71dbdaa2d94d425fff4a59e10eb5be9f61a2661 (patch) | |
tree | 8c5e8f5cfee998d332b4a1797c0fc1d7cec41563 /net/bpfilter | |
parent | f03329627b46c28f0682040e7ddbfd346b78bd4e (diff) | |
download | linux-d71dbdaa2d94d425fff4a59e10eb5be9f61a2661.tar.gz linux-d71dbdaa2d94d425fff4a59e10eb5be9f61a2661.tar.bz2 linux-d71dbdaa2d94d425fff4a59e10eb5be9f61a2661.zip |
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: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bpfilter')
-rw-r--r-- | net/bpfilter/bpfilter_kern.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/bpfilter/bpfilter_kern.c b/net/bpfilter/bpfilter_kern.c index 7596314b61c7..b13d058f8c34 100644 --- a/net/bpfilter/bpfilter_kern.c +++ b/net/bpfilter/bpfilter_kern.c @@ -33,7 +33,8 @@ static void shutdown_umh(struct umh_info *info) static void __stop_umh(void) { - if (bpfilter_process_sockopt) { + if (IS_ENABLED(CONFIG_INET) && + bpfilter_process_sockopt) { bpfilter_process_sockopt = NULL; shutdown_umh(&info); } @@ -98,7 +99,9 @@ static int __init load_umh(void) stop_umh(); return -EFAULT; } - bpfilter_process_sockopt = &__bpfilter_process_sockopt; + if (IS_ENABLED(CONFIG_INET)) + bpfilter_process_sockopt = &__bpfilter_process_sockopt; + return 0; } |