mptcp match -- kernel space

Basic match for xtables. Kernel part of the mechanism used by iptables to
detect the presence of the mptcp option in a TCP packet.
Support for ipv4 and ipv6.

Only internal flags are: XT_MPTCP_PRESENT and XT_MPTCP_PRESENT_INV
add mptcp match module in compilation config files
bugfixes: xt_mptcp match is working

- fixes find_mptcp_option: tcphdr pointer (was pointing to iphdr instead)
- stop using XT_MPTCP_PRESENT and INVERT flags
- fixes a lot of small bugs
- little debug function: prints a buffer in hex (used for skb printing)
Fix: Don't access tcp_hdr in the TCP-stack

Because skb->transport_header is only set in tcp_transmit_skb, where the
tcp-header is written. Before that, all necessary info is in
tcp_skb_cb->tcp_flags.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Cleanup

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Minor: Use zalloc instead memsetting to 0

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: We have to lock the socket before iterating

Otherwise, subsockets may get removed in between.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Minor: Cleanup

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Set sk_error_report elsewhere

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Create custom work-queue for parallel work-execution

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Don't wakeup on subflow creation

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Cleanup locking architecture

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Handle pskb_copy differently

68dae05f5eead7fda0e1a6fb057af215752f11d1 introduced a bug. Actually,
skb->len does not anymore reflect tcb->end_seq - tcb->seq and thus we
had all kind of strange behaviors under certain conditions.

This patch reverts it back again and handles pskb_copy in
tcp_transmit_skb as needed.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Use bh_lock_sock_nested in mptcp_lookup_join

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Remove time-wait-sock when handling MP_JOIN

Otherwise the socket will be in a strange state. We thus have to
properly remove it upon reception of a valid SYN with MP_JOIN.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Cache-line optimizations

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Ignore csum-field if it has not been negotiated

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Update pointers correctly in tcp_sendmsg

This may happen, if the socket becomes mp-capable while waiting in
lock_sock(sk). Thus, pointers need to get updated.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Support tcp_disconnect with meta-sk

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
mptcp: consolidate tcp_skb_cb by moving path_mask into a union

The path_mask field is used on the send path while the header field is
used on the received side, so we can reduce the tcp_skb_cb size by
creating union for the path_mask and header fields.

This patch also reverts the size of sk_buff back to 48 since now
the size of tcp_skb_cb is back to 44 bytes.

Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>