diff options
author | Gaurav Sinha <gaurav.sinha@vyatta.com> | 2012-01-18 12:05:50 -0800 |
---|---|---|
committer | Gaurav Sinha <gaurav.sinha@vyatta.com> | 2012-01-18 12:05:50 -0800 |
commit | e72ca98329a25414108e2af350c4014de9e8f736 (patch) | |
tree | dfd32da0647916edf9a055e44d9d59596a3721a8 /extensions/libct_proto_tcp.c | |
parent | fa0e506210775233cb34513d45878991ef50aae6 (diff) | |
parent | ca37a710d526d17490ebdc3af760bfddd316426d (diff) | |
download | conntrack-tools-expect-sync.tar.gz conntrack-tools-expect-sync.zip |
Creating development branch expect-sync, has merged content from oxnard and upstreamexpect-sync
Diffstat (limited to 'extensions/libct_proto_tcp.c')
-rw-r--r-- | extensions/libct_proto_tcp.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/extensions/libct_proto_tcp.c b/extensions/libct_proto_tcp.c index cb573d0..0b43bf5 100644 --- a/extensions/libct_proto_tcp.c +++ b/extensions/libct_proto_tcp.c @@ -82,7 +82,8 @@ static const char *tcp_states[TCP_CONNTRACK_MAX] = { [TCP_CONNTRACK_LAST_ACK] = "LAST_ACK", [TCP_CONNTRACK_TIME_WAIT] = "TIME_WAIT", [TCP_CONNTRACK_CLOSE] = "CLOSE", - [TCP_CONNTRACK_LISTEN] = "LISTEN" + /* Since Linux kernel 2.6.31, LISTEN is SYN_SENT2. */ + [TCP_CONNTRACK_SYN_SENT2] = "SYN_SENT2" }; static void help(void) @@ -151,7 +152,11 @@ static int parse_options(char c, break; } } - if (i == TCP_CONNTRACK_MAX) + /* For backward compatibility with Linux kernel < 2.6.31. */ + if (strcmp(optarg, "LISTEN") == 0) { + nfct_set_attr_u8(ct, ATTR_TCP_STATE, + TCP_CONNTRACK_LISTEN); + } else if (i == TCP_CONNTRACK_MAX) exit_error(PARAMETER_PROBLEM, "unknown TCP state `%s'", optarg); *flags |= CT_TCP_STATE; |