Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c5c4e45c authored by Marcelo Ricardo Leitner's avatar Marcelo Ricardo Leitner Committed by David S. Miller
Browse files

sctp: fix GSO for IPv6



commit 90017acc ("sctp: Add GSO support") didn't register SCTP GSO
offloading for IPv6 and yet didn't put any restrictions on generating
GSO packets while in IPv6, which causes all IPv6 GSO'ed packets to be
silently dropped.

The fix is to properly register the offload this time.

Fixes: 90017acc ("sctp: Add GSO support")
Signed-off-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e5b13f34
Loading
Loading
Loading
Loading
+22 −1
Original line number Diff line number Diff line
@@ -92,7 +92,28 @@ static const struct net_offload sctp_offload = {
	},
};

static const struct net_offload sctp6_offload = {
	.callbacks = {
		.gso_segment = sctp_gso_segment,
	},
};

int __init sctp_offload_init(void)
{
	return inet_add_offload(&sctp_offload, IPPROTO_SCTP);
	int ret;

	ret = inet_add_offload(&sctp_offload, IPPROTO_SCTP);
	if (ret)
		goto out;

	ret = inet6_add_offload(&sctp6_offload, IPPROTO_SCTP);
	if (ret)
		goto ipv4;

	return ret;

ipv4:
	inet_del_offload(&sctp_offload, IPPROTO_SCTP);
out:
	return ret;
}