Lines Matching refs:skb
18 int (*xmit)(struct sk_buff *skb);
23 static int sch_frag_xmit(struct net *net, struct sock *sk, struct sk_buff *skb) in sch_frag_xmit() argument
27 if (skb_cow_head(skb, data->l2_len) < 0) { in sch_frag_xmit()
28 kfree_skb(skb); in sch_frag_xmit()
32 __skb_dst_copy(skb, data->dst); in sch_frag_xmit()
33 *qdisc_skb_cb(skb) = data->cb; in sch_frag_xmit()
34 skb->inner_protocol = data->inner_protocol; in sch_frag_xmit()
36 __vlan_hwaccel_put_tag(skb, data->vlan_proto, in sch_frag_xmit()
39 __vlan_hwaccel_clear_tag(skb); in sch_frag_xmit()
42 skb_push(skb, data->l2_len); in sch_frag_xmit()
43 memcpy(skb->data, &data->l2_data, data->l2_len); in sch_frag_xmit()
44 skb_postpush_rcsum(skb, skb->data, data->l2_len); in sch_frag_xmit()
45 skb_reset_mac_header(skb); in sch_frag_xmit()
47 return data->xmit(skb); in sch_frag_xmit()
50 static void sch_frag_prepare_frag(struct sk_buff *skb, in sch_frag_prepare_frag() argument
51 int (*xmit)(struct sk_buff *skb)) in sch_frag_prepare_frag() argument
53 unsigned int hlen = skb_network_offset(skb); in sch_frag_prepare_frag()
57 data->dst = skb->_skb_refdst; in sch_frag_prepare_frag()
58 data->cb = *qdisc_skb_cb(skb); in sch_frag_prepare_frag()
60 data->inner_protocol = skb->inner_protocol; in sch_frag_prepare_frag()
61 if (skb_vlan_tag_present(skb)) in sch_frag_prepare_frag()
62 data->vlan_tci = skb_vlan_tag_get(skb) | VLAN_CFI_MASK; in sch_frag_prepare_frag()
65 data->vlan_proto = skb->vlan_proto; in sch_frag_prepare_frag()
67 memcpy(&data->l2_data, skb->data, hlen); in sch_frag_prepare_frag()
69 memset(IPCB(skb), 0, sizeof(struct inet_skb_parm)); in sch_frag_prepare_frag()
70 skb_pull(skb, hlen); in sch_frag_prepare_frag()
84 static int sch_fragment(struct net *net, struct sk_buff *skb, in sch_fragment() argument
85 u16 mru, int (*xmit)(struct sk_buff *skb)) in sch_fragment() argument
89 if (skb_network_offset(skb) > VLAN_ETH_HLEN) { in sch_fragment()
94 if (skb_protocol(skb, true) == htons(ETH_P_IP)) { in sch_fragment()
98 sch_frag_prepare_frag(skb, xmit); in sch_fragment()
101 sch_frag_rt.dst.dev = skb->dev; in sch_fragment()
103 orig_dst = skb->_skb_refdst; in sch_fragment()
104 skb_dst_set_noref(skb, &sch_frag_rt.dst); in sch_fragment()
105 IPCB(skb)->frag_max_size = mru; in sch_fragment()
107 ret = ip_do_fragment(net, skb->sk, skb, sch_frag_xmit); in sch_fragment()
109 } else if (skb_protocol(skb, true) == htons(ETH_P_IPV6)) { in sch_fragment()
113 sch_frag_prepare_frag(skb, xmit); in sch_fragment()
117 sch_frag_rt.dst.dev = skb->dev; in sch_fragment()
119 orig_dst = skb->_skb_refdst; in sch_fragment()
120 skb_dst_set_noref(skb, &sch_frag_rt.dst); in sch_fragment()
121 IP6CB(skb)->frag_max_size = mru; in sch_fragment()
123 ret = ipv6_stub->ipv6_fragment(net, skb->sk, skb, in sch_fragment()
128 netdev_name(skb->dev), in sch_fragment()
129 ntohs(skb_protocol(skb, true)), mru, in sch_fragment()
130 skb->dev->mtu); in sch_fragment()
136 kfree_skb(skb); in sch_fragment()
140 int sch_frag_xmit_hook(struct sk_buff *skb, int (*xmit)(struct sk_buff *skb)) in sch_frag_xmit_hook() argument
142 u16 mru = tc_skb_cb(skb)->mru; in sch_frag_xmit_hook()
145 if (mru && skb->len > mru + skb->dev->hard_header_len) in sch_frag_xmit_hook()
146 err = sch_fragment(dev_net(skb->dev), skb, mru, xmit); in sch_frag_xmit_hook()
148 err = xmit(skb); in sch_frag_xmit_hook()