Lines Matching refs:skb
87 static int tcf_nat(struct sk_buff *skb, const struct tc_action *a, in tcf_nat() argument
110 bstats_update(&p->tcf_bstats, skb); in tcf_nat()
117 noff = skb_network_offset(skb); in tcf_nat()
118 if (!pskb_may_pull(skb, sizeof(*iph) + noff)) in tcf_nat()
121 iph = ip_hdr(skb); in tcf_nat()
129 if (skb_cloned(skb) && in tcf_nat()
130 !skb_clone_writable(skb, sizeof(*iph) + noff) && in tcf_nat()
131 pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) in tcf_nat()
138 iph = ip_hdr(skb); in tcf_nat()
158 if (!pskb_may_pull(skb, ihl + sizeof(*tcph) + noff) || in tcf_nat()
159 (skb_cloned(skb) && in tcf_nat()
160 !skb_clone_writable(skb, ihl + sizeof(*tcph) + noff) && in tcf_nat()
161 pskb_expand_head(skb, 0, 0, GFP_ATOMIC))) in tcf_nat()
164 tcph = (void *)(skb_network_header(skb) + ihl); in tcf_nat()
165 inet_proto_csum_replace4(&tcph->check, skb, addr, new_addr, in tcf_nat()
173 if (!pskb_may_pull(skb, ihl + sizeof(*udph) + noff) || in tcf_nat()
174 (skb_cloned(skb) && in tcf_nat()
175 !skb_clone_writable(skb, ihl + sizeof(*udph) + noff) && in tcf_nat()
176 pskb_expand_head(skb, 0, 0, GFP_ATOMIC))) in tcf_nat()
179 udph = (void *)(skb_network_header(skb) + ihl); in tcf_nat()
180 if (udph->check || skb->ip_summed == CHECKSUM_PARTIAL) { in tcf_nat()
181 inet_proto_csum_replace4(&udph->check, skb, addr, in tcf_nat()
192 if (!pskb_may_pull(skb, ihl + sizeof(*icmph) + noff)) in tcf_nat()
195 icmph = (void *)(skb_network_header(skb) + ihl); in tcf_nat()
202 if (!pskb_may_pull(skb, ihl + sizeof(*icmph) + sizeof(*iph) + in tcf_nat()
206 icmph = (void *)(skb_network_header(skb) + ihl); in tcf_nat()
216 if (skb_cloned(skb) && in tcf_nat()
217 !skb_clone_writable(skb, ihl + sizeof(*icmph) + in tcf_nat()
219 pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) in tcf_nat()
222 icmph = (void *)(skb_network_header(skb) + ihl); in tcf_nat()
234 inet_proto_csum_replace4(&icmph->checksum, skb, addr, new_addr, in tcf_nat()
252 static int tcf_nat_dump(struct sk_buff *skb, struct tc_action *a, in tcf_nat_dump() argument
255 unsigned char *b = skb_tail_pointer(skb); in tcf_nat_dump()
270 if (nla_put(skb, TCA_NAT_PARMS, sizeof(opt), &opt)) in tcf_nat_dump()
275 if (nla_put(skb, TCA_NAT_TM, sizeof(t), &t)) in tcf_nat_dump()
278 return skb->len; in tcf_nat_dump()
281 nlmsg_trim(skb, b); in tcf_nat_dump()