summaryrefslogtreecommitdiffstats
path: root/src/sync-ftfw.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2008-11-02 21:29:04 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2008-11-02 21:29:04 +0100
commit64ce47955778805afceb6ced58b63839763541ad (patch)
treebf67f80a47e7d46d3d8649f4a6e8b73a9e53d599 /src/sync-ftfw.c
parent43694a92f5521537109f14ec5fb9c8f4b2a821f6 (diff)
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 <pablo@netfilter.org>
Diffstat (limited to 'src/sync-ftfw.c')
-rw-r--r--src/sync-ftfw.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/sync-ftfw.c b/src/sync-ftfw.c
index ed97ceb..598945f 100644
--- a/src/sync-ftfw.c
+++ b/src/sync-ftfw.c
@@ -477,14 +477,12 @@ static void ftfw_send(struct nethdr *net, struct us_conntrack *u)
hello_state = HELLO_SAY;
/* fall through */
case HELLO_SAY:
- net->flags = ntohs(net->flags) | NET_F_HELLO;
- net->flags = htons(net->flags);
+ net->flags |= NET_F_HELLO;
break;
}
if (say_hello_back) {
- net->flags = ntohs(net->flags) | NET_F_HELLO_BACK;
- net->flags = htons(net->flags);
+ net->flags |= NET_F_HELLO_BACK;
say_hello_back = 0;
}
@@ -501,7 +499,7 @@ static int tx_queue_xmit(void *data1, const void *data2)
size_t len = prepare_send_netmsg(STATE_SYNC(mcast_client), net);
dp("tx_queue sq: %u fl:%u len:%u\n",
- ntohl(net->seq), ntohs(net->flags), ntohs(net->len));
+ ntohl(net->seq), net->flags, ntohs(net->len));
mcast_buffered_send_netmsg(STATE_SYNC(mcast_client), net, len);
HDR_NETWORK2HOST(net);
@@ -521,8 +519,7 @@ static int tx_list_xmit(struct list_head *i, struct us_conntrack *u, int type)
size_t len = prepare_send_netmsg(STATE_SYNC(mcast_client), net);
dp("tx_list sq: %u fl:%u len:%u\n",
- ntohl(net->seq), ntohs(net->flags),
- ntohs(net->len));
+ ntohl(net->seq), net->flags, ntohs(net->len));
list_del_init(i);
tx_list_len--;