atomic_t in_pkts; /* incoming packet counter */
/* packet transmitter for different forwarding methods. If it
- mangles the packet, it must return NF_DROP or NF_STOLEN, otherwise
- this must be changed to a sk_buff **.
+ mangles the packet, it must return NF_DROP or better NF_STOLEN,
+ otherwise this must be changed to a sk_buff **.
*/
int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp,
struct ip_vs_protocol *pp);
/* transmit the first SYN packet */
ret = cp->packet_xmit(skb, cp, pp);
+ /* do not touch skb anymore */
atomic_inc(&cp->in_pkts);
ip_vs_conn_put(cp);
drop:
ip_vs_conn_put(cp);
- return NF_DROP;
+ kfree_skb(*pskb);
+ return NF_STOLEN;
}
if (IPPROTO_TCP == ciph.protocol || IPPROTO_UDP == ciph.protocol)
offset += 2 * sizeof(__u16);
verdict = ip_vs_icmp_xmit(skb, cp, pp, offset);
+ /* do not touch skb anymore */
out:
__ip_vs_conn_put(cp);
restart = ip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pp);
if (cp->packet_xmit)
ret = cp->packet_xmit(skb, cp, pp);
+ /* do not touch skb anymore */
else {
IP_VS_DBG_RL("warning: packet_xmit is null");
ret = NF_ACCEPT;
ip_vs_null_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
struct ip_vs_protocol *pp)
{
+ /* we do not touch skb and do not need pskb ptr */
return NF_ACCEPT;
}
tx_error_icmp:
dst_link_failure(skb);
tx_error:
+ kfree_skb(skb);
LeaveFunction(10);
- return NF_DROP;
+ return NF_STOLEN;
}
dst_link_failure(skb);
tx_error:
LeaveFunction(10);
- return NF_DROP;
+ kfree_skb(skb);
+ return NF_STOLEN;
tx_error_put:
ip_rt_put(rt);
goto tx_error;
skb_realloc_headroom(skb, max_headroom);
if (!new_skb) {
ip_rt_put(rt);
+ kfree_skb(skb);
IP_VS_ERR_RL("ip_vs_tunnel_xmit(): no memory\n");
- return NF_DROP;
+ return NF_STOLEN;
}
kfree_skb(skb);
skb = new_skb;
tx_error_icmp:
dst_link_failure(skb);
tx_error:
+ kfree_skb(skb);
LeaveFunction(10);
- return NF_DROP;
+ return NF_STOLEN;
}
tx_error_icmp:
dst_link_failure(skb);
tx_error:
+ kfree_skb(skb);
LeaveFunction(10);
- return NF_DROP;
+ return NF_STOLEN;
}
rc = cp->packet_xmit(skb, cp, pp);
else
rc = NF_ACCEPT;
+ /* do not touch skb anymore */
atomic_inc(&cp->in_pkts);
__ip_vs_conn_put(cp);
goto out;