]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
netfilter: nfnl_hook: fix unused variable warning
authorArnd Bergmann <arnd@arndb.de>
Wed, 21 Jul 2021 15:22:32 +0000 (17:22 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 23 Jul 2021 12:45:03 +0000 (14:45 +0200)
The only user of this variable is in an #ifdef:

net/netfilter/nfnetlink_hook.c: In function 'nfnl_hook_entries_head':
net/netfilter/nfnetlink_hook.c:177:28: error: unused variable 'netdev' [-Werror=unused-variable]

Fixes: e2cf17d3774c ("netfilter: add new hook nfnl subsystem")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nfnetlink_hook.c

index 50b4e3c9347a56d1e054a3b047513a2ce1e52154..202f57d17bab8474aea378a3955a76a29796874f 100644 (file)
@@ -174,7 +174,9 @@ static const struct nf_hook_entries *
 nfnl_hook_entries_head(u8 pf, unsigned int hook, struct net *net, const char *dev)
 {
        const struct nf_hook_entries *hook_head = NULL;
+#ifdef CONFIG_NETFILTER_INGRESS
        struct net_device *netdev;
+#endif
 
        switch (pf) {
        case NFPROTO_IPV4: