]> git.baikalelectronics.ru Git - kernel.git/commit
openvswitch: load and reference the NAT helper.
authorFlavio Leitner <fbl@redhat.com>
Wed, 17 Apr 2019 14:46:17 +0000 (11:46 -0300)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 30 Apr 2019 12:19:56 +0000 (14:19 +0200)
commit1fd9133be34521ddf96cbd6f9650a9c2d65c1999
tree52245b89381ed3290fe55738b4243236d3e4cf08
parentd678848616fc5ca8017e7af25959ba9a8dfd4b17
openvswitch: load and reference the NAT helper.

This improves the original commit 1dc6def856e9 ("openvswitch: load
NAT helper") where it unconditionally tries to load the module for
every flow using NAT, so not efficient when loading multiple flows.
It also doesn't hold any references to the NAT module while the
flow is active.

This change fixes those problems. It will try to load the module
only if it's not present. It grabs a reference to the NAT module
and holds it while the flow is active. Finally, an error message
shows up if either actions above fails.

Fixes: 1dc6def856e9 ("openvswitch: load NAT helper")
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/openvswitch/conntrack.c