diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2008-11-02 21:29:04 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2008-11-02 21:29:04 +0100 |
commit | 64ce47955778805afceb6ced58b63839763541ad (patch) | |
tree | bf67f80a47e7d46d3d8649f4a6e8b73a9e53d599 /src/network.c | |
parent | 43694a92f5521537109f14ec5fb9c8f4b2a821f6 (diff) | |
download | conntrack-tools-64ce47955778805afceb6ced58b63839763541ad.tar.gz conntrack-tools-64ce47955778805afceb6ced58b63839763541ad.zip |
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/network.c')
-rw-r--r-- | src/network.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); |