diff options
author | Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> | 2016-07-15 16:40:02 -0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-16 22:02:09 -0700 |
commit | c5c4e45c4b79acb23f07e43dac1348e67b4ddf91 (patch) | |
tree | 2d8301b1cdf6ee86ad4e296a4dc67eb7ce2c1b11 /net/sctp | |
parent | e5b13f3444dfe4f014343e83aa7948b83ef58168 (diff) | |
download | linux-c5c4e45c4b79acb23f07e43dac1348e67b4ddf91.tar.gz linux-c5c4e45c4b79acb23f07e43dac1348e67b4ddf91.tar.bz2 linux-c5c4e45c4b79acb23f07e43dac1348e67b4ddf91.zip |
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>
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/offload.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/net/sctp/offload.c b/net/sctp/offload.c index a37887b373a7..7e869d0cca69 100644 --- a/net/sctp/offload.c +++ b/net/sctp/offload.c @@ -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; } |