diff options
author | Julian Anastasov <ja@ssi.bg> | 2020-06-21 18:40:30 +0300 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-06-30 19:37:39 +0300 |
commit | 857ca89711de3dbcc674d58a6d7d297ee0bd34e1 (patch) | |
tree | 35f960b740abc6ce65adc8f408aa7ef56ddf814a /include/net/ip_vs.h | |
parent | d61d2e902aa0561e5f4b6348514fb35de544aa1f (diff) | |
download | linux-857ca89711de3dbcc674d58a6d7d297ee0bd34e1.tar.xz |
ipvs: register hooks only with services
Keep the IPVS hooks registered in Netfilter only
while there are configured virtual services. This
saves CPU cycles while IPVS is loaded but not used.
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/net/ip_vs.h')
-rw-r--r-- | include/net/ip_vs.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 83be2d93b407..0c9881241323 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h @@ -874,6 +874,7 @@ struct netns_ipvs { struct ip_vs_stats tot_stats; /* Statistics & est. */ int num_services; /* no of virtual services */ + int num_services6; /* IPv6 virtual services */ /* Trash for destinations */ struct list_head dest_trash; @@ -960,6 +961,7 @@ struct netns_ipvs { * are not supported when synchronization is enabled. */ unsigned int mixed_address_family_dests; + unsigned int hooks_afmask; /* &1=AF_INET, &2=AF_INET6 */ }; #define DEFAULT_SYNC_THRESHOLD 3 @@ -1670,6 +1672,9 @@ static inline void ip_vs_unregister_conntrack(struct ip_vs_service *svc) #endif } +int ip_vs_register_hooks(struct netns_ipvs *ipvs, unsigned int af); +void ip_vs_unregister_hooks(struct netns_ipvs *ipvs, unsigned int af); + static inline int ip_vs_dest_conn_overhead(struct ip_vs_dest *dest) { |