@@ -278,25 +278,21 @@ int ip6_xmit(const struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6,
struct ipv6hdr *hdr;
u8 proto = fl6->flowi6_proto;
int seg_len = skb->len;
- int hlimit = -1;
+ int delta, hlimit = -1;
u32 mtu;
head_room = sizeof(struct ipv6hdr) + LL_RESERVED_SPACE(dst->dev);
if (opt)
head_room += opt->opt_nflen + opt->opt_flen;
- if (unlikely(skb_headroom(skb) < head_room)) {
- struct sk_buff *skb2 = skb_realloc_headroom(skb, head_room);
- if (!skb2) {
- IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)),
+ delta = head_room - skb_headroom(skb);
+ if (unlikely(delta > 0)) {
+ skb = skb_expand_head(skb, delta);
+ if (!skb) {
+ IP6_INC_STATS(net, ip6_dst_idev(dst),
IPSTATS_MIB_OUTDISCARDS);
- kfree_skb(skb);
return -ENOBUFS;
}
- if (skb->sk)
- skb_set_owner_w(skb2, skb->sk);
- consume_skb(skb);
- skb = skb2;
}
if (opt) {
By this way can be changed: pptp_xmit vrf_finish_output ax25_transmit_buffer ax25_rt_build_path bpf_out_neigh_v6 bpf_out_neigh_v4 ip_finish_output2 ip6_tnl_xmit ipip6_tunnel_xmit ip_vs_prepare_tunneled_skb Signed-off-by: Vasily Averin <vvs@virtuozzo.com> --- net/ipv6/ip6_output.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)