FIX: Allow unrecognized new subflows on the server.

If the client is configured with mptcp_ndiffPorts, but the server not,
the server will crash. This is due to the fact that he wants to find a
path in the path_array with the corresponding IP addresses. However, if
mptcp_ndiffPorts is enabled on the client, the IP addresses will be
those of the master-socket. Thus, find_path_mapping4 will not find the
related path, and we will BUG_ON(!p).

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
FIX: IFUP/IFDOWN - Don't act on non-mp-capable mpcb's

The check assures, that we only act on the mpcb's that belong to a
master-socket which is mp-capable.
Otherwise, there is a bug, when shutting down the machine, because we
enter mtcp_init_subsockets on a non-mpc mpcb, because list_rcvd has been
set to 1 in mtcp_pm_inetaddr_event.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
FIX: now checking if the token attached to a MP_JOIN SYN/ACK is valid or not.

The token sent in the SYN/ACK must be the client's token, otherwise the connection
is RSTed by the client.

mtcp_lookup_join should be called only on a SYN, not a SYN/ACK.

Signed-off-by: Fabien Duchêne <fabien.duchene@uclouvain.be>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
bug fix: added flag-based check for presence of data_ack option.

This is slightly less efficient, given it consumes 8 bytes more of the
TCP_SKB_CB. (in fact 1 byte only, but we are required to align on 8 bytes).
Previously the data_ack presence was verified through a zero-value check,
which is incorrect given 0 is a legal value for a data-ack.

Signed-off-by: Sébastien Barré <sebastien.barre@uclouvain.be>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
cleanup: removed unused structure

Signed-off-by: Sébastien Barré <sebastien.barre@uclouvain.be>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
bug fix: init of mtcp_pm

if there is an error when creating the proc file, proc_net_remove()
was erroneously called.
We also replace mtcp_pm with mptcp_pm

Signed-off-by: Sébastien Barré <sebastien.barre@uclouvain.be>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
The token is not part of MPTCP Path Management

The token is part of MPTCP. It has nothing to do with the path
management.

Together with this patch is the usual cleanup.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Support draft v03 for MPTCP-CAPABLE option

This commit supports the option-format as defined by mptcp-draft version
03.

However, we still not support the key-management as defined in the
draft. Current security is still based on draft 01.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Support draft v03 for MPTCP-JOIN option

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Support draft v03 for MPTCP-DSS option

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Support draft v03 for MPTCP-ADD_ADDR option

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Take all option space into account in tcp_established_options

One byte was missed when checking the available option space in
tcp_established_options.
um: adjust current_thread_info() for newer gcc versions

In some cases gcc >= 4.5.2 will optimize away current_thread_info().  To
prevent gcc from doing so the stack address has to be obtained via inline
asm.

Signed-off-by: Richard Weinberger <richard@nod.at>
Acked-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
check cleanup

-removed duplicate check
-replace print with BUG_ON, because if the condition is false, a bug happens right after the check anyway.

Signed-off-by: Sébastien Barré <sebastien.barre@uclouvain.be>
Cleanup tcp_snd_wnd_test

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Merge branch 'mptcp_2.6.36' into mptcp_trunk

Conflicts:
	include/net/sock.h
	net/core/request_sock.c
	net/core/sock.c
	net/ipv4/tcp_input.c
	net/ipv4/tcp_ipv4.c
	net/ipv4/tcp_output.c
	net/ipv4/tcp_probe.c
	net/ipv6/tcp_ipv6.c
	net/xfrm/xfrm_policy.c

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix wrong merge.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
MPTCP-IPv6: Fix compilation without IPv6 enabled.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix Merge - dst_metric -> dst_metric_advmss

In 2.6.38 we cannot call dst_metric with RTAX_ADVMSS. We have to call
dst_metric_advmss.

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

Port-numbers are in network-byte-order. Thus they need to get casted.

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