From 64ce47955778805afceb6ced58b63839763541ad Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sun, 2 Nov 2008 21:29:04 +0100 Subject: network: add protocol version field (breaks backward compatibility) This patch adds the version field (8-bits long) to the nethdr structure. This fields can be used to indicate the protocol version in case that we detect an incompatibility between two conntrackd daemons working with different protocol versions. Unfortunately, this patch breaks backward compatibility, ie. conntrackd <= 0.9.8 protocol is not compatible with the upcoming conntrackd >= 0.9.9. Better do this now than later. Signed-off-by: Pablo Neira Ayuso --- src/network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/network.c') diff --git a/src/network.c b/src/network.c index 7d1d9fa..04c9d39 100644 --- a/src/network.c +++ b/src/network.c @@ -32,8 +32,7 @@ static size_t __do_send(struct mcast_sock *m, void *data, size_t len) struct nethdr *net = data; debug("send sq: %u fl:%u len:%u\n", - ntohl(net->seq), ntohs(net->flags), - ntohs(net->len)); + ntohl(net->seq), net->flags, ntohs(net->len)); return mcast_send(m, net, len); } @@ -46,6 +45,7 @@ static size_t __do_prepare(struct mcast_sock *m, void *data, size_t len) seq_set = 1; cur_seq = time(NULL); } + net->version = CONNTRACKD_PROTOCOL_VERSION; net->len = len; net->seq = cur_seq++; HDR_HOST2NETWORK(net); -- cgit v1.2.3