Fix: Correctly initialize security on meta-sk

When creating the meta-sk we have also to set the sk_security-pointer.
Otherwise he will be pointing to the one from the master_sk and will
thus get free'd twice at the end.

Reporde-by: Stephen Hankinson <stephen.hankinson@quarkengineering.com>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Handle rcv_ssthresh at the meta-level

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Set pushed_seq and snd_up in mptcp_alloc_mpcb

pushed_seq and snd_up were not initialized correctly in the meta-sk.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Initialize snd_wl1 and snd_wnd in mptcp_alloc_mpcb

This simplifies a little bit the window-code.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Set advmss in mptcp_alloc_mpcb

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

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Make the rcvbuf fully handled at the meta-level

With the previous design, where tcp_rcv_space_adjust was called on the
subsocket, as soon as copied-seq changed, it behaved as if the
application is reading at infinite speed. Because segments are always
directly taken out of the subflow-receive-queue.

We have to calculate the receive-buffer at the meta-level, taking into
account the application-speed.

This patch fixes this, by calling tcp_rcv_space_adjust on the
meta-socket.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Restore the old tcp_prequeue

We now add the packets in the meta-level prequeue. This largely
simplifies the code, is safer in terms of receive-buffer-handling and
reduces cpu-cycles as we don't anymore have to iterate over all sockets
in tcp_recvmsg.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Review buffer-handling when new subflows are added.

We just add the new subflow's rcv-buffer and window-clamp to the
meta-buffer. This allows traffic on the new subflow. Auto-tuning will
later further increase the meta-buffer to allow full speed on the new
subflow.

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

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

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

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Remove BUG() in address-handler

It may be, that the user-space tries to add twice the same address. This
will still generate a net-event. Even if it doesn't has an impact on the
interface-configuration itself.

We would then crash, because the address is already in the list. Adding
twice the same address is maybe not very smart from the user-space, but
he is allowed to do so.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Call sock_rps_record_flow in mptcp_v*_do_rcv

A call to sock_rps_record_flow was added to mptcp_v*_do_rcv in order to
mimic what is done in tcp_v*_do_rcv. This allows to enable RPS directly
for new subflows when receiving the third ack and not after receiving
the first data segment.

Signed-off-by: Gregory Detal <gregory.detal@uclouvain.be>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>