All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ipvs: use SYNC_MESG_HEADER_LEN instead of explicit header length
@ 2010-12-12 11:41 Tinggong Wang
  2010-12-12 11:42 ` [PATCH 2/3] ipvs: check data validation before local_bh_disable Tinggong Wang
  2010-12-12 21:46 ` [PATCH 1/3] ipvs: use SYNC_MESG_HEADER_LEN instead of explicit header length Simon Horman
  0 siblings, 2 replies; 17+ messages in thread
From: Tinggong Wang @ 2010-12-12 11:41 UTC (permalink / raw)
  To: Wensong Zhang, Simon Horman, lvs-devel

Signed-off-by: Tinggong Wang <wangtinggong@gmail.com>
---
 net/netfilter/ipvs/ip_vs_sync.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index ab85aed..7632a17 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -102,7 +102,6 @@ struct ip_vs_sync_thread_data {
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 */
 
-#define SYNC_MESG_HEADER_LEN	4
 #define MAX_CONNS_PER_SYNCBUFF	255 /* nr_conns in ip_vs_sync_mesg is 8 bit */
 
 struct ip_vs_sync_mesg {
@@ -112,6 +111,7 @@ struct ip_vs_sync_mesg {
 
 	/* ip_vs_sync_conn entries start here */
 };
+#define SYNC_MESG_HEADER_LEN	(sizeof(struct ip_vs_sync_mesg))
 
 /* the maximum length of sync (sending/receiving) message */
 static int sync_send_mesg_maxlen;
@@ -188,8 +188,8 @@ static inline struct ip_vs_sync_buff * ip_vs_sync_buff_create(void)
 	}
 	sb->mesg->nr_conns = 0;
 	sb->mesg->syncid = ip_vs_master_syncid;
-	sb->mesg->size = 4;
-	sb->head = (unsigned char *)sb->mesg + 4;
+	sb->mesg->size = SYNC_MESG_HEADER_LEN;
+	sb->head = (unsigned char *)sb->mesg + SYNC_MESG_HEADER_LEN;
 	sb->end = (unsigned char *)sb->mesg + sync_send_mesg_maxlen;
 	sb->firstuse = jiffies;
 	return sb;
@@ -315,7 +315,7 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen)
 	char *p;
 	int i;
 
-	if (buflen < sizeof(struct ip_vs_sync_mesg)) {
+	if (buflen < SYNC_MESG_HEADER_LEN) {
 		IP_VS_ERR_RL("sync message header too short\n");
 		return;
 	}
@@ -335,7 +335,7 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen)
 		return;
 	}
 
-	p = (char *)buffer + sizeof(struct ip_vs_sync_mesg);
+	p = (char *)buffer + SYNC_MESG_HEADER_LEN;
 	for (i=0; i<m->nr_conns; i++) {
 		unsigned flags, state;
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2010-12-15  8:28 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-12 11:41 [PATCH 1/3] ipvs: use SYNC_MESG_HEADER_LEN instead of explicit header length Tinggong Wang
2010-12-12 11:42 ` [PATCH 2/3] ipvs: check data validation before local_bh_disable Tinggong Wang
2010-12-12 11:43   ` [PATCH 3/3] ipvs: fix get_curr_sync_buff Tinggong Wang
2010-12-12 21:49     ` Simon Horman
2010-12-13  9:21       ` Hans Schillstrom
2010-12-13 23:32     ` Julian Anastasov
2010-12-14  3:00       ` Tinggong Wang
2010-12-14  8:28         ` Julian Anastasov
2010-12-15  8:28           ` Simon Horman
2010-12-12 21:48   ` [PATCH 2/3] ipvs: check data validation before local_bh_disable Simon Horman
2010-12-13  3:44     ` Tinggong Wang
2010-12-13  6:29       ` Simon Horman
2010-12-13  8:53         ` Hans Schillstrom
2010-12-13 10:49           ` Tinggong Wang
2010-12-13 18:06             ` Tinggong Wang
2010-12-12 21:46 ` [PATCH 1/3] ipvs: use SYNC_MESG_HEADER_LEN instead of explicit header length Simon Horman
2010-12-13  8:16   ` Hans Schillstrom

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.