bug fix: prevent mptcp on loopback not only for v4, but also v6.

Signed-off-by: Sébastien Barré <sebastien.barre@uclouvain.be>
added debug info for bug 66

Signed-off-by: Sébastien Barré <sebastien.barre@uclouvain.be>
replaced misleading comment in mtcp_hash_remove()

It was told that a request_sock was detached from the local hashtable, while
in fact it was not. (code is correct, but comment was incorrect).

Signed-off-by: Sébastien Barré <sebastien.barre@uclouvain.be>
FIX: Divison by zero in mtcp_fc_cong_avoid

This may happen, if the mpcb is not attached to the sock at the
initialization, and thus alpha == 0.
If then, we enter congestion avoidance, we will make a divison by zero.

Together with this commit is some minor cleanup and addition of
'unlikely' to speed up the execution.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
bug fix: remove request_sock from tuple hashtable upon embryonic reset

Since the request_sock is freed in that case, we otherwise corrupt the
tuple hashtable.

Signed-off-by: Sébastien Barré <sebastien.barre@uclouvain.be>
merge fix: tcp_poll

*Bad mask return in case the mpcb is in shutdown state.
*The two versions of tcp_poll have now sufficiently converged. We merge them.

Signed-off-by: Sébastien Barré <sebastien.barre@uclouvain.be>
bug fix #56: attach all child subsockets before destroying the mpcb

This ensures the mpcb cannot die before any of its childs. It is needed
because, although the mpcb is not reachable anymore for incoming packets
after destroy() (because it removed from the hashtables), the child subsockets
are all reachable through the normal socket lookup process.

Signed-off-by: Sébastien Barré <sebastien.barre@uclouvain.be>
bug fix: uninitialized struct multipath_options in tcp_timewait_state_process

as well as some cosmetic changes related to the usage of that struct.

Signed-off-by: Sébastien Barré <sebastien.barre@uclouvain.be>
Disable MPTCP when connecting to a local address

MPTCP brings no benefits if used locally.

Signed-off-by: Sébastien Barré <sebastien.barre@uclouvain.be>
FIX: do a find_path_mapping when we do not do multi-port

In mtcp_check_new_subflow, we did find_path_mapping4, only if
sysctl_mptcp_ndiffports > 1, which makes no sense.

This commit fixes this and also corrects the Coding Style.

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

Removed declaration of mtcpsub_get_port, and cleaned up according to
Coding Style Guidelines.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Cleanup: net/ipv4/tcp_input.c

Remove the noisy "measured rtt is:" and general cleanup to respect the
Linux Coding Style Guidelines.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Cleanup: General cleanup and removing trailing whitespace

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
net/ipv4/mtcp.c: move mpcb_put/get to include/net/mtcp.h

There was a compiler-warning on x86-architectures, because of the
different declarations of mpcb_put/get.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Cleanup include/net/mtcp.h: Remove unnecessary header-files

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Bug#64 - end_data_seq can be equal to 0

It may be zero, because meta_tp->write_seq can wrap-around.
And as we set end_data_seq = meta_tp->write_seq in mtcp_skb_entail, we
MAY come back to 0.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
bug fix: MPTCP state machine

*It was possible to go from FIN_WAIT1/LAST_ACK to ESTABLISHED
*the initial state was TCPF_CLOSE instead of TCP_CLOSE

Signed-off-by: Sébastien Barré <sebastien.barre@uclouvain.be>
removed old debug info

Signed-off-by: Sébastien Barré <sebastien.barre@uclouvain.be>
bug fix: allow tso if tp->mpc is not set

*When tp->mpc is not set, do_tcp_sendpages() can be called, and it seems
that this function uses various tso segs. So we need to support
this is tcp_write_xmit().

*Also, the packets_out verif in tcp_clean_rtx_queue is not needed, given
packets_out accounts (I hope at least) for each fragment of each skb, and can
hence be higher then the write queue length;

*restablished tcp_mss_split_point(), removed in commit 29f0966e15.
It is used only if tp->mpc is not set, but is needed in that case.

*Restablished call to tcp_init_tso_segs() tcp_snd_test().
It is needed, even without tso, to initialize some fields.

Signed-off-by: Sébastien Barré <sebastien.barre@uclouvain.be>
bug fix: bug #54

The mpcb attached to the childs of a listen sock that we close was not
freed nor detached from the hashtables. It was hence still accessible
for JOIN requests to access it, although the master_sk was not there anymore.
That lead to a number of funny situations.

Note that this bug fix copy-pastes some code from
inet_csk_listen_stop(). This will be removed later at next architecture revision.
At the moment this looks to be the safest path to a stable kernel.

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