Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sctp: fix GSO for IPv6

commit 90017accff61 ("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: 90017accff61 ("sctp: Add GSO support")
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Marcelo Ricardo Leitner and committed by
David S. Miller
c5c4e45c e5b13f34

+22 -1
+22 -1
net/sctp/offload.c
··· 92 92 }, 93 93 }; 94 94 95 + static const struct net_offload sctp6_offload = { 96 + .callbacks = { 97 + .gso_segment = sctp_gso_segment, 98 + }, 99 + }; 100 + 95 101 int __init sctp_offload_init(void) 96 102 { 97 - return inet_add_offload(&sctp_offload, IPPROTO_SCTP); 103 + int ret; 104 + 105 + ret = inet_add_offload(&sctp_offload, IPPROTO_SCTP); 106 + if (ret) 107 + goto out; 108 + 109 + ret = inet6_add_offload(&sctp6_offload, IPPROTO_SCTP); 110 + if (ret) 111 + goto ipv4; 112 + 113 + return ret; 114 + 115 + ipv4: 116 + inet_del_offload(&sctp_offload, IPPROTO_SCTP); 117 + out: 118 + return ret; 98 119 }