net: use skb_is_gso_sctp() instead of open-coding

As well as the basic conversion, I noticed that a lot of the
SCTP code checks gso_type without first checking skb_is_gso()
so I have added that where appropriate.

Also, document the helper.

Cc: Daniel Borkmann <[email protected]>
Cc: Marcelo Ricardo Leitner <[email protected]>
Signed-off-by: Daniel Axtens <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
Daniel Axtens 2018-03-09 14:06:09 +11:00 • committed by David S. Miller
commit 1dd27cde30
6 changed files with 12 additions and 9 deletions

View file

@ -155,7 +155,10 @@ Therefore, any code in the core networking stack must be aware of the
possibility that gso_size will be GSO_BY_FRAGS and handle that case
appropriately.
There are a couple of helpers to make this easier:
There are some helpers to make this easier:
- skb_is_gso(skb) && skb_is_gso_sctp(skb) is the best way to see if
an skb is an SCTP GSO skb.
- For size checks, the skb_gso_validate_*_len family of helpers correctly
considers GSO_BY_FRAGS.