Fix: Don't fallback if subflow-only fin is acked

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Correctly check for SYN-flag in mptcp_data_ack

The tcp_flags are not set for incoming packets. We thus cannot check
there for a SYN-packet. We have to check the tcp-header.

Similar fix in mptcp_skb_split_tail. The fin-flag is handled some lines
higher within this function.

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

Conflicts:

	net/mptcp/mptcp_input.c
Fix: Initialize last_rbuf_opti correctly

It must be set to the correct timestamp as we create the mptcp_tcp_sock.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Update window on all subflows for fast recovery

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

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: olia: Divide by 0

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
drm/i915/sdvo: clean up connectors on intel_sdvo_init() failures

Any failures in intel_sdvo_init() after the intel_sdvo_setup_output() call
left behind ghost connectors, attached (with a dangling pointer) to the
sdvo that has been cleaned up and freed. Properly destroy any connectors
attached to the encoder.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=46381
CC: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Cc: stable@vger.kernel.org
Tested-by: bjo@nord-west.org
[danvet: added a comment to explain why we need to clean up connectors
even when sdvo_output_setup fails.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

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

Conflicts:

	drivers/gpu/drm/i915/intel_sdvo.c
Fix: Olia: Correctly scale in Olia

Provided by Ramin Khalili.
We have to use u64 in mptcp_olia_scale, because it's argument is u64.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix olia based on recommendation from Ramin

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Memoryleak when processing backlog-queue

If the refcnt was already zero, we will not process the received
segment. We thus have to free it to avoid the memory-leak.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Correctly destroy socket upon failure

When mptcp_create_master_sk fails, we have to destroy the meta too,
because the error gets propagated down to tcp_check_req, where we hit
the listen_overflow.

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

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Handle meta-socket in inet_csk_listen_stop

We have to hold the mutex, to prevent any work-queue from accessing the
meta-sk while closing it.

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

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

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Handle error-signals correctly while in fallback-mode

If we have fallen back to regular TCP, we should interpret a RST or any
other error-signal (e.g., coming from tcp_v4_err) as an error on the
whole connection.

This patch modifies mptcp_sock_def_error_report, to check on the
infinite-flags of the mpcb and propagate the error up to the
meta-socket.

Reported-by: Krishna Khanal <krishna.khanal2@citrix.com>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Tested-by: Krishna Khanal <krishna.khanal2@citrix.com>
Fix: Let meta-socket timeout if no subflow is ready to reinject

If we go to out_reset_timer, icsk_retransmits will not get increased,
and the meta-socket will *never* time out, hanging around there forever.

This patch adds a new label, allowing icsk_retransmits to be
incremented, if no subflow is available for sending.

Reported-by: Justin Collery <justin.collery@quantumvpn.com>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Check for socket-state when combining dfin with subflow-fin

When checking if we can combine a data-fin with a subflow-fin, we look
if all subflows have nothing to send. We must check the socket's state,
because un-established sockets may still have the SYN-packet in their
write-queue.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Fix: Close remaining subflows when the meta socket disappears

We may enter tcp_v4_destroy_sock, while there are still active subflows.
This may happen e.g., when the closure is unsuccessfull due to a
retransmission timeout (tcp_write_err). We should then close the
subflows, because otherwise they will hang around there forever, waiting
for a call to mptcp_sub_close - which will never happen.

We try to do graceful closure of the subflows (not using
mptcp_sub_force_close), as the subflows may still be usable - and we
always prefer graceful closure.

Reported-by: Justin Collery <justin.collery@quantumvpn.com>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Tested-by: Justin Collery <justin.collery@quantumvpn.com>
Fix: Launch keepalive-timer on FIN_WAIT2-sockets

If the socket enters FIN_WAIT2 and he is dead, we have to launch the
keepalive-timer if we don't want to enter tcp_time_wait(). Otherwise he
will hang around there forever, because the app has already given up on
the socket, and no timer is referencing him anymore.

This code must get removed again as soon as we support TIME-WAIT-sockets
correctly.

Reported-by: Justin Collery <justin.collery@quantumvpn.com>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Tested-by: Justin Collery <justin.collery@quantumvpn.com>