mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
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 <[email protected]> Cc: Florian Westphal <[email protected]> Signed-off-by: Shmulik Ladkani <[email protected]> Acked-by: Hannes Frederic Sowa <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
dfa15378bd
commit
359ebda25a
4 changed files with 7 additions and 4 deletions
|
|
@ -117,7 +117,7 @@ int ip_forward(struct sk_buff *skb)
|
|||
if (opt->is_strictroute && rt->rt_uses_gateway)
|
||||
goto sr_failed;
|
||||
|
||||
IPCB(skb)->flags |= IPSKB_FORWARDED;
|
||||
IPCB(skb)->flags |= IPSKB_FORWARDED | IPSKB_FRAG_SEGS;
|
||||
mtu = ip_dst_mtu_maybe_forward(&rt->dst, true);
|
||||
if (ip_exceeds_mtu(skb, mtu)) {
|
||||
IP_INC_STATS(net, IPSTATS_MIB_FRAGFAILS);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -1749,7 +1749,7 @@ static void ipmr_queue_xmit(struct net *net, struct mr_table *mrt,
|
|||
vif->dev->stats.tx_bytes += skb->len;
|
||||
}
|
||||
|
||||
IPCB(skb)->flags |= IPSKB_FORWARDED;
|
||||
IPCB(skb)->flags |= IPSKB_FORWARDED | IPSKB_FRAG_SEGS;
|
||||
|
||||
/* RFC1584 teaches, that DVMRP/PIM router must deliver packets locally
|
||||
* not only before forwarding, but after forwarding on all output
|
||||
|
|
|
|||
Loading…
Reference in a new issue