Пример #1
0
static int ip6_finish_output(struct sk_buff *skb)
{
	if ((skb->len > ip6_skb_dst_mtu(skb) && !skb_is_gso(skb)) ||
	    dst_allfrag(skb_dst(skb)))
		return ip6_fragment(skb, ip6_finish_output2);
	else
		return ip6_finish_output2(skb);
}
Пример #2
0
int ip6_output(struct sk_buff *skb)
{
	if ((skb->len > dst_mtu(skb->dst) && !skb_is_gso(skb)) ||
				dst_allfrag(skb->dst))
		return ip6_fragment(skb, ip6_output2);
	else
		return ip6_output2(skb);
}
Пример #3
0
int ip6_output(struct sk_buff *skb)
{
	if ((skb->len > dst_mtu(skb->dst) && !skb_shinfo(skb)->ufo_size) ||
				dst_allfrag(skb->dst))
		return ip6_fragment(skb, ip6_output2);
	else
		return ip6_output2(skb);
}
Пример #4
0
static int ip6_finish_output(struct net *net, struct sock *sk, struct sk_buff *skb)
{
	if ((skb->len > ip6_skb_dst_mtu(skb) && !skb_is_gso(skb)) ||
	    dst_allfrag(skb_dst(skb)) ||
	    (IP6CB(skb)->frag_max_size && skb->len > IP6CB(skb)->frag_max_size))
		return ip6_fragment(net, sk, skb, ip6_finish_output2);
	else
		return ip6_finish_output2(net, sk, skb);
}
Пример #5
0
static int __xfrm6_output(struct sk_buff *skb)
{
	struct dst_entry *dst = skb->dst;
	struct xfrm_state *x = dst->xfrm;

	if ((x && x->props.mode == XFRM_MODE_TUNNEL) &&
	    ((skb->len > dst_mtu(skb->dst) && !skb_is_gso(skb)) ||
		dst_allfrag(skb->dst))) {
			return ip6_fragment(skb, xfrm6_output_finish);
	}
	return xfrm6_output_finish(skb);
}
Пример #6
0
int ip6_output(struct sk_buff *skb)
{
	struct inet6_dev *idev = ip6_dst_idev(skb->dst);
	if (unlikely(idev->cnf.disable_ipv6)) {
		IP6_INC_STATS(idev, IPSTATS_MIB_OUTDISCARDS);
		kfree_skb(skb);
		return 0;
	}

	if ((skb->len > ip6_skb_dst_mtu(skb) && !skb_is_gso(skb)) ||
				dst_allfrag(skb->dst))
		return ip6_fragment(skb, ip6_output2);
	else
		return ip6_output2(skb);
}
Пример #7
0
static int ip6_finish_output(struct net *net, struct sock *sk, struct sk_buff *skb)
{
	int ret;

	ret = BPF_CGROUP_RUN_PROG_INET_EGRESS(sk, skb);
	if (ret) {
		kfree_skb(skb);
		return ret;
	}

	if ((skb->len > ip6_skb_dst_mtu(skb) && !skb_is_gso(skb)) ||
	    dst_allfrag(skb_dst(skb)) ||
	    (IP6CB(skb)->frag_max_size && skb->len > IP6CB(skb)->frag_max_size))
		return ip6_fragment(net, sk, skb, ip6_finish_output2);
	else
		return ip6_finish_output2(net, sk, skb);
}
Пример #8
0
int ip6_output(struct sk_buff *skb)
{
	struct inet6_dev *idev = ip6_dst_idev(skb->dst);
	struct net_device_extended *ext = dev_extended(idev->dev);

	if (unlikely(ext && ext->ipv6_devconf_ext.disable_ipv6)) {
		IP6_INC_STATS(idev, IPSTATS_MIB_OUTDISCARDS);
		kfree_skb(skb);
		return 0;
	}

	if ((skb->len > dst_mtu(skb->dst) && !skb_is_gso(skb)) ||
				dst_allfrag(skb->dst))
		return ip6_fragment(skb, ip6_output2);
	else
		return ip6_output2(skb);
}
Пример #9
0
static int __xfrm6_output(struct net *net, struct sock *sk, struct sk_buff *skb)
{
	struct dst_entry *dst = skb_dst(skb);
	struct xfrm_state *x = dst->xfrm;
	int mtu;
	bool toobig;

#ifdef CONFIG_NETFILTER
	if (!x) {
		IP6CB(skb)->flags |= IP6SKB_REROUTED;
		return dst_output(net, sk, skb);
	}
#endif

	if (x->props.mode != XFRM_MODE_TUNNEL)
		goto skip_frag;

	if (skb->protocol == htons(ETH_P_IPV6))
		mtu = ip6_skb_dst_mtu(skb);
	else
		mtu = dst_mtu(skb_dst(skb));

	toobig = skb->len > mtu && !skb_is_gso(skb);

	if (toobig && xfrm6_local_dontfrag(skb)) {
		xfrm6_local_rxpmtu(skb, mtu);
		kfree_skb(skb);
		return -EMSGSIZE;
	} else if (!skb->ignore_df && toobig && skb->sk) {
		xfrm_local_error(skb, mtu);
		kfree_skb(skb);
		return -EMSGSIZE;
	}

	if (toobig || dst_allfrag(skb_dst(skb)))
		return ip6_fragment(net, sk, skb,
				    __xfrm6_output_finish);

skip_frag:
	return x->outer_mode->afinfo->output_finish(sk, skb);
}
Пример #10
0
static int __xfrm6_output(struct sk_buff *skb)
{
    struct dst_entry *dst = skb_dst(skb);
    struct xfrm_state *x = dst->xfrm;
    int mtu = ip6_skb_dst_mtu(skb);

    if (skb->len > mtu && xfrm6_local_dontfrag(skb)) {
        xfrm6_local_rxpmtu(skb, mtu);
        return -EMSGSIZE;
    } else if (!skb->local_df && skb->len > mtu && skb->sk) {
        xfrm6_local_error(skb, mtu);
        return -EMSGSIZE;
    }

    if ((x && x->props.mode == XFRM_MODE_TUNNEL) &&
            ((skb->len > mtu && !skb_is_gso(skb)) ||
             dst_allfrag(skb_dst(skb)))) {
        return ip6_fragment(skb, x->outer_mode->afinfo->output_finish);
    }
    return x->outer_mode->afinfo->output_finish(skb);
}