IPVS: Backup, Adding Version 1 receive capability
Subsystems (4)
PATCH 5/7 IPVS: Backup, Adding Version 1 receive capability
Functionality improvements
* flags changed from 16 to 32 bits
* fwmark added (32 bits)
* timeout in sec. added (32 bits)
* pe data added (Variable length)
* IPv6 capabilities (3x16 bytes for addr.)
* Version and type in every conn msg.
ip_vs_process_message() now handles Version 1 messages and will call ip_vs_process_message_v0() for version 0 messages.
ip_vs_proc_conn() is common for both version, and handles the update of connection hash.
ip_vs_conn_fill_param_sync() - Version 1 messages onlyip_vs_conn_fill_param_sync_v0() - Version 0 messages only
*v4
get_unaligned_be32, used.
in ip_vs_conn_fill_param_sync():
- when pe_name_len is 0 and pe_data_len != 0 (return 1)
- put p->pe when alloc fails.
- __u8 used instead of char.
formatting,
some minor corrections according to Julians review. Change sync_conn length to exclude padding.
*v3
formatting...
timeout checked against MAX_SCHEDULE_TIMEOUT ip_vs_conn_fill_param_sync_v0 removed.
Incl. Patch "IPVS: buffer argument to ip_vs_process_message() should not be const" msgEnd renamed to msg_end
removal of fault SVER_MASK in m2->size & SVER_MASK kmalloc(pe_data_len, GFP_ATOMIC); leakage stopped
Version 1 struct ip_vs_seq in network order.
Rework of Debug/Error messages, BACKUP for Rx SYNC for Tx
and Debug level <= 3 only errors and >= 7 misc debugging
Process of V1 messages slitted.
*v2
A new option format added as with opt, opt-len, data as a general way to add options to a conn entry. timeout is now in seconds
fwmark is not in ip_vs_conn_param any more. Mask for flags received by backup.
Basically all changes implements Julians comments.
--- include/linux/ip_vs.h | 8 + include/net/ip_vs.h | 1 + net/netfilter/ipvs/ip_vs_pe.c | 5 +- net/netfilter/ipvs/ip_vs_sync.c | 549 ++++++++++++++++++++++++++++++--------- 4 files changed, 440 insertions(+), 123 deletions(-)
include/linux/ip_vs.h +8 -0
@@ -89,6 +89,14 @@#define IP_VS_CONN_F_TEMPLATE 0x1000/* template, not connection */ #define IP_VS_CONN_F_ONE_PACKET 0x2000/* forward only one packet */ +#define IP_VS_CONN_F_BACKUP_MASK (IP_VS_CONN_F_FWD_MASK | \ + IP_VS_CONN_F_NOOUTPUT | \ + IP_VS_CONN_F_INACTIVE | \ + IP_VS_CONN_F_SEQ_MASK | \ + IP_VS_CONN_F_NO_CPORT | \ + IP_VS_CONN_F_TEMPLATE \ + ) +/* Flags that are not sent to backup server start from bit 16 */ #define IP_VS_CONN_F_NFCT (1 << 16)/* use netfilter conntrack */
include/net/ip_vs.h +1 -0
@@ -817,6 +817,7 @@ void ip_vs_unbind_pe(struct ip_vs_service *svc);int register_ip_vs_pe (struct ip_vs_pe *pe);int unregister_ip_vs_pe (struct ip_vs_pe *pe);struct ip_vs_pe *ip_vs_pe_getbyname (const char *name); +struct ip_vs_pe *__ip_vs_pe_getbyname (const char *pe_name);static inline void ip_vs_pe_get (const struct ip_vs_pe *pe) {
net/netfilter/ipvs/ip_vs_pe.c +2 -3
@@ -29,12 +29,11 @@ void ip_vs_unbind_pe(struct ip_vs_service *svc) }/* Get pe in the pe list by name */ -static struct ip_vs_pe * -__ip_vs_pe_getbyname (const char *pe_name) +struct ip_vs_pe *__ip_vs_pe_getbyname (const char *pe_name) {struct ip_vs_pe *pe; -IP_VS_DBG (2 ,"%s(): pe_name \"%s\"\n" , __func__, +IP_VS_DBG (10 ,"%s(): pe_name \"%s\"\n" , __func__, pe_name);spin_lock_bh (&ip_vs_pe_lock);
net/netfilter/ipvs/ip_vs_sync.c +429 -120
622 lines not on this page · raw message
Signature · 1 line
1.7.2.3