diff options
author | Sachin Saxena <sachin.saxena@freescale.com> | 2013-03-04 10:24:25 (GMT) |
---|---|---|
committer | Fleming Andrew-AFLEMING <AFLEMING@freescale.com> | 2013-04-03 21:28:44 (GMT) |
commit | 4b8566e1321be5169322a25fc627cc68222c3e7c (patch) | |
tree | 4e5f848ba9b1ac7246cee1cf45bbef28e3f910ed /net | |
parent | 772bf4a78d23b9452c30de5a0a3f596ce3955edc (diff) | |
download | linux-fsl-qoriq-4b8566e1321be5169322a25fc627cc68222c3e7c.tar.xz |
netfilter/ipv4: Offload TCP session information in ip_ct_tcp_state
Passing TCP session information in the ip_ct_tcp_state structure
which is used by packet offload engine for handling offloaded
TCP sessions.
Signed-off-by: Arun Pathak <arun.pathak@freescale.com>
Signed-off-by: Sachin Saxena <sachin.saxena@freescale.com>
Change-Id: I68b7d315971dc6e8d7a40cd7ccdbc71813c10b1e
Reviewed-on: http://git.am.freescale.net:8181/877
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/ip_options.c | 2 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_proto_tcp.c | 42 |
2 files changed, 42 insertions, 2 deletions
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c index fd72bd0..a47fc1d 100644 --- a/net/ipv4/ip_options.c +++ b/net/ipv4/ip_options.c @@ -604,9 +604,7 @@ void ip_forward_options(struct sk_buff *skb) ip_send_check(ip_hdr(skb)); } } -#ifdef CONFIG_AS_FASTPATH EXPORT_SYMBOL(ip_forward_options); -#endif int ip_options_rcv_srr(struct sk_buff *skb) { diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c index 83876e9..e4caf79 100644 --- a/net/netfilter/nf_conntrack_proto_tcp.c +++ b/net/netfilter/nf_conntrack_proto_tcp.c @@ -713,6 +713,48 @@ static bool tcp_in_window(const struct nf_conn *ct, state->retrans = 0; } } + +#ifdef CONFIG_AS_FASTPATH + state->seen[dir].td_delta = receiver_offset; + state->seen[dir].td_rcvwin = win; + /* Setting Time stamp */ + { + unsigned char *tcpopt; + unsigned char *endptr; + int optlen; + tcpopt = (unsigned char *)(tcph) + 20; + optlen = tcph->doff * 4 - 20; + if (optlen > 0) { + endptr = tcpopt + optlen; + while (tcpopt < endptr) { + if (tcpopt[1] <= 0) + break; + + switch (*tcpopt) { + case TCPOPT_EOL: + case TCPOPT_NOP: + tcpopt++; + break; + case TCPOPT_MSS: + tcpopt += 4; /* 4 byte option length */ + break; + case TCPOPT_WINDOW: + tcpopt += 3; /* 3 byte option length */ + break; + case TCPOPT_TIMESTAMP: + state->seen[dir].td_tcptimestamp = + ntohl(*((unsigned long *) + (tcpopt + 2))); + goto DONE; + default: + tcpopt += tcpopt[1]; + break; + } + } + } + } +DONE: +#endif res = true; } else { res = false; |