]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nfnetlink_log: consolidate check for instance in nfulnl_recv_config()
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 13 Oct 2015 10:47:47 +0000 (12:47 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 15 Oct 2015 04:44:31 +0000 (06:44 +0200)
commitf1173a45f5de1a312ea1cad9da981e9b18d679e6
tree51a34113111215dd00b95769a594aed6b7ff1a2a
parent5550569f313e69c266802dd5ad5898bac787bb89
netfilter: nfnetlink_log: consolidate check for instance in nfulnl_recv_config()

This patch consolidates the check for valid logger instance once we have
passed the command handling:

The config message that we receive may contain the following info:

1) Command only: We always get a valid instance pointer if we just
   created it. In case that the instance is being destroyed or the
   command is unknown, we jump to exit path of nfulnl_recv_config().
   This patch doesn't modify this handling.

2) Config only: In this case, the instance must always exist since the
   user is asking for configuration updates. If the instance doesn't exist
   this returns -ENODEV.

3) No command and no configs are specified: This case is rare. The
   user is sending us a config message with neither commands nor
   config options. In this case, we have to check if the instance exists
   and bail out otherwise. Before this patch, it was possible to send a
   config message with no command and no config updates for an
   unexisting instance without triggering an error. So this is the only
   case that changes.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Tested-by: Ken-ichirou MATSUZAWA <chamaken@gmail.com>
net/netfilter/nfnetlink_log.c