Lines Matching refs:skb
86 static int tcf_nat(struct sk_buff *skb, const struct tc_action *a, in tcf_nat() argument
109 bstats_update(&p->tcf_bstats, skb); in tcf_nat()
116 noff = skb_network_offset(skb); in tcf_nat()
117 if (!pskb_may_pull(skb, sizeof(*iph) + noff)) in tcf_nat()
120 iph = ip_hdr(skb); in tcf_nat()
128 if (skb_cloned(skb) && in tcf_nat()
129 !skb_clone_writable(skb, sizeof(*iph) + noff) && in tcf_nat()
130 pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) in tcf_nat()
137 iph = ip_hdr(skb); in tcf_nat()
157 if (!pskb_may_pull(skb, ihl + sizeof(*tcph) + noff) || in tcf_nat()
158 (skb_cloned(skb) && in tcf_nat()
159 !skb_clone_writable(skb, ihl + sizeof(*tcph) + noff) && in tcf_nat()
160 pskb_expand_head(skb, 0, 0, GFP_ATOMIC))) in tcf_nat()
163 tcph = (void *)(skb_network_header(skb) + ihl); in tcf_nat()
164 inet_proto_csum_replace4(&tcph->check, skb, addr, new_addr, 1); in tcf_nat()
171 if (!pskb_may_pull(skb, ihl + sizeof(*udph) + noff) || in tcf_nat()
172 (skb_cloned(skb) && in tcf_nat()
173 !skb_clone_writable(skb, ihl + sizeof(*udph) + noff) && in tcf_nat()
174 pskb_expand_head(skb, 0, 0, GFP_ATOMIC))) in tcf_nat()
177 udph = (void *)(skb_network_header(skb) + ihl); in tcf_nat()
178 if (udph->check || skb->ip_summed == CHECKSUM_PARTIAL) { in tcf_nat()
179 inet_proto_csum_replace4(&udph->check, skb, addr, in tcf_nat()
190 if (!pskb_may_pull(skb, ihl + sizeof(*icmph) + noff)) in tcf_nat()
193 icmph = (void *)(skb_network_header(skb) + ihl); in tcf_nat()
200 if (!pskb_may_pull(skb, ihl + sizeof(*icmph) + sizeof(*iph) + in tcf_nat()
204 icmph = (void *)(skb_network_header(skb) + ihl); in tcf_nat()
214 if (skb_cloned(skb) && in tcf_nat()
215 !skb_clone_writable(skb, ihl + sizeof(*icmph) + in tcf_nat()
217 pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) in tcf_nat()
220 icmph = (void *)(skb_network_header(skb) + ihl); in tcf_nat()
232 inet_proto_csum_replace4(&icmph->checksum, skb, addr, new_addr, in tcf_nat()
250 static int tcf_nat_dump(struct sk_buff *skb, struct tc_action *a, in tcf_nat_dump() argument
253 unsigned char *b = skb_tail_pointer(skb); in tcf_nat_dump()
268 if (nla_put(skb, TCA_NAT_PARMS, sizeof(opt), &opt)) in tcf_nat_dump()
273 if (nla_put(skb, TCA_NAT_TM, sizeof(t), &t)) in tcf_nat_dump()
276 return skb->len; in tcf_nat_dump()
279 nlmsg_trim(skb, b); in tcf_nat_dump()