summaryrefslogtreecommitdiffstats
path: root/net/mpls
diff options
context:
space:
mode:
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>2016-06-02 15:05:41 -0300
committerDavid S. Miller <davem@davemloft.net>2016-06-03 19:37:21 -0400
commitae7ef81ef000adeee7a87585b9135ff8a8064acc (patch)
tree50968928f3eed74570ba0b79afc8eef29200c86e /net/mpls
parent3953c46c3ac7eef31a9935427371c6f54a22f1ba (diff)
downloadlinux-stable-ae7ef81ef000adeee7a87585b9135ff8a8064acc.tar.gz
linux-stable-ae7ef81ef000adeee7a87585b9135ff8a8064acc.tar.bz2
linux-stable-ae7ef81ef000adeee7a87585b9135ff8a8064acc.zip
skbuff: introduce skb_gso_validate_mtu
skb_gso_network_seglen is not enough for checking fragment sizes if skb is using GSO_BY_FRAGS as we have to check frag per frag. This patch introduces skb_gso_validate_mtu, based on the former, which will wrap the use case inside it as all calls to skb_gso_network_seglen were to validate if it fits on a given TMU, and improve the check. Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Tested-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mpls')
-rw-r--r--net/mpls/af_mpls.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c
index 0b80a7140cc4..7a4aa3450dd7 100644
--- a/net/mpls/af_mpls.c
+++ b/net/mpls/af_mpls.c
@@ -91,7 +91,7 @@ bool mpls_pkt_too_big(const struct sk_buff *skb, unsigned int mtu)
if (skb->len <= mtu)
return false;
- if (skb_is_gso(skb) && skb_gso_network_seglen(skb) <= mtu)
+ if (skb_is_gso(skb) && skb_gso_validate_mtu(skb, mtu))
return false;
return true;