diff options
author | Shmulik Ladkani <shmulik.ladkani@gmail.com> | 2016-07-18 14:49:33 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-19 16:40:22 -0700 |
commit | 359ebda25aa06fe3a1d028f7e338a849165e661b (patch) | |
tree | f3bf5da129f7922ebd9aefd4f27c17d10934bff7 /net/ipv4/ip_output.c | |
parent | dfa15378bd69c6b193a483725889dd90c1a7dd48 (diff) | |
download | linux-359ebda25aa06fe3a1d028f7e338a849165e661b.tar.bz2 |
net/ipv4: Introduce IPSKB_FRAG_SEGS bit to inet_skb_parm.flags
This flag indicates whether fragmentation of segments is allowed.
Formerly this policy was hardcoded according to IPSKB_FORWARDED (set by
either ip_forward or ipmr_forward).
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: Florian Westphal <fw@strlen.de>
Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_output.c')
-rw-r--r-- | net/ipv4/ip_output.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index e23f141c9ba5..dde37fb340bf 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -223,8 +223,10 @@ static int ip_finish_output_gso(struct net *net, struct sock *sk, struct sk_buff *segs; int ret = 0; - /* common case: locally created skb or seglen is <= mtu */ - if (((IPCB(skb)->flags & IPSKB_FORWARDED) == 0) || + /* common case: fragmentation of segments is not allowed, + * or seglen is <= mtu + */ + if (((IPCB(skb)->flags & IPSKB_FRAG_SEGS) == 0) || skb_gso_validate_mtu(skb, mtu)) return ip_finish_output2(net, sk, skb); |