aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ip_vs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/ip_vs.h')
-rw-r--r--include/net/ip_vs.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index a0bec23c6d5e..a0d2e0bb9a94 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -335,6 +335,11 @@ enum ip_vs_sctp_states {
335 IP_VS_SCTP_S_LAST 335 IP_VS_SCTP_S_LAST
336}; 336};
337 337
338/* Connection templates use bits from state */
339#define IP_VS_CTPL_S_NONE 0x0000
340#define IP_VS_CTPL_S_ASSURED 0x0001
341#define IP_VS_CTPL_S_LAST 0x0002
342
338/* Delta sequence info structure 343/* Delta sequence info structure
339 * Each ip_vs_conn has 2 (output AND input seq. changes). 344 * Each ip_vs_conn has 2 (output AND input seq. changes).
340 * Only used in the VS/NAT. 345 * Only used in the VS/NAT.
@@ -1221,7 +1226,7 @@ struct ip_vs_conn *ip_vs_conn_new(const struct ip_vs_conn_param *p, int dest_af,
1221 struct ip_vs_dest *dest, __u32 fwmark); 1226 struct ip_vs_dest *dest, __u32 fwmark);
1222void ip_vs_conn_expire_now(struct ip_vs_conn *cp); 1227void ip_vs_conn_expire_now(struct ip_vs_conn *cp);
1223 1228
1224const char *ip_vs_state_name(__u16 proto, int state); 1229const char *ip_vs_state_name(const struct ip_vs_conn *cp);
1225 1230
1226void ip_vs_tcp_conn_listen(struct ip_vs_conn *cp); 1231void ip_vs_tcp_conn_listen(struct ip_vs_conn *cp);
1227int ip_vs_check_template(struct ip_vs_conn *ct, struct ip_vs_dest *cdest); 1232int ip_vs_check_template(struct ip_vs_conn *ct, struct ip_vs_dest *cdest);
@@ -1289,6 +1294,17 @@ ip_vs_control_add(struct ip_vs_conn *cp, struct ip_vs_conn *ctl_cp)
1289 atomic_inc(&ctl_cp->n_control); 1294 atomic_inc(&ctl_cp->n_control);
1290} 1295}
1291 1296
1297/* Mark our template as assured */
1298static inline void
1299ip_vs_control_assure_ct(struct ip_vs_conn *cp)
1300{
1301 struct ip_vs_conn *ct = cp->control;
1302
1303 if (ct && !(ct->state & IP_VS_CTPL_S_ASSURED) &&
1304 (ct->flags & IP_VS_CONN_F_TEMPLATE))
1305 ct->state |= IP_VS_CTPL_S_ASSURED;
1306}
1307
1292/* IPVS netns init & cleanup functions */ 1308/* IPVS netns init & cleanup functions */
1293int ip_vs_estimator_net_init(struct netns_ipvs *ipvs); 1309int ip_vs_estimator_net_init(struct netns_ipvs *ipvs);
1294int ip_vs_control_net_init(struct netns_ipvs *ipvs); 1310int ip_vs_control_net_init(struct netns_ipvs *ipvs);