aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
authorYasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp>2007-03-14 19:44:01 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:25:55 -0400
commite7ac05f3407a3fb5a1b2ff5d5554899eaa0a10a3 (patch)
treed8360ce670e1a60110ef6ddff20399129c51eefc /include/linux/skbuff.h
parentedda553c324bdc5bb5c2d553b524cab37058a855 (diff)
[NETFILTER]: nf_conntrack: add nf_copy() to safely copy members in skb
This unifies the codes to copy netfilter related datas. Before copying, nf_copy() puts original members in destination skb. Signed-off-by: Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 62ab1ab07028..47c57be97d43 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1514,9 +1514,22 @@ static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src)
1514#endif 1514#endif
1515} 1515}
1516 1516
1517static inline void nf_copy(struct sk_buff *dst, const struct sk_buff *src)
1518{
1519 nf_conntrack_put(dst->nfct);
1520#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
1521 nf_conntrack_put_reasm(dst->nfct_reasm);
1522#endif
1523#ifdef CONFIG_BRIDGE_NETFILTER
1524 nf_bridge_put(dst->nf_bridge);
1525#endif
1526 __nf_copy(dst, src);
1527}
1528
1517#else /* CONFIG_NETFILTER */ 1529#else /* CONFIG_NETFILTER */
1518static inline void nf_reset(struct sk_buff *skb) {} 1530static inline void nf_reset(struct sk_buff *skb) {}
1519static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src) {} 1531static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src) {}
1532static inline void nf_copy(struct sk_buff *dst, const struct sk_buff *src) {}
1520#endif /* CONFIG_NETFILTER */ 1533#endif /* CONFIG_NETFILTER */
1521 1534
1522#ifdef CONFIG_NETWORK_SECMARK 1535#ifdef CONFIG_NETWORK_SECMARK