From 181661850dbc7cccf4c81b2d682ad3108cb45b29 Mon Sep 17 00:00:00 2001 From: Sapan Bhatia Date: Wed, 3 Jun 2009 03:22:11 +0000 Subject: [PATCH] Ok. I need to stop editing patches by hand. --- ...-2.6-522-iptables-connection-tagging.patch | 84 ++++++++++++++++++- 1 file changed, 83 insertions(+), 1 deletion(-) diff --git a/linux-2.6-522-iptables-connection-tagging.patch b/linux-2.6-522-iptables-connection-tagging.patch index 125593099..774f7fe82 100644 --- a/linux-2.6-522-iptables-connection-tagging.patch +++ b/linux-2.6-522-iptables-connection-tagging.patch @@ -378,4 +378,86 @@ diff -Nurb linux-2.6.27-521/net/netfilter/xt_MARK.c linux-2.6.27-522/net/netfilt - skb->mark = (skb->mark & ~info->mask) ^ info->mark; return XT_CONTINUE; } - +diff -Nurb linux-2.6.27-521/net/netfilter/xt_SETXID.c linux-2.6.27-522-ol/net/netfilter/xt_SETXID.c +--- linux-2.6.27-521/net/netfilter/xt_SETXID.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.27-522-ol/net/netfilter/xt_SETXID.c 2009-06-02 10:02:16.000000000 -0400 +@@ -0,0 +1,79 @@ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++MODULE_LICENSE("GPL"); ++MODULE_AUTHOR(""); ++MODULE_DESCRIPTION(""); ++MODULE_ALIAS("ipt_SETXID"); ++ ++static unsigned int ++target_v1(struct sk_buff **pskb, ++ const struct net_device *in, ++ const struct net_device *out, ++ unsigned int hooknum, ++ const struct xt_target *target, ++ const void *targinfo) ++{ ++ const struct xt_setxid_target_info_v1 *setxidinfo = targinfo; ++ ++ switch (setxidinfo->mode) { ++ case XT_SET_PACKET_XID: ++ (*pskb)->skb_tag = setxidinfo->mark; ++ break; ++ } ++ return XT_CONTINUE; ++} ++ ++ ++static int ++checkentry_v1(const char *tablename, ++ const void *entry, ++ const struct xt_target *target, ++ void *targinfo, ++ unsigned int hook_mask) ++{ ++ struct xt_setxid_target_info_v1 *setxidinfo = targinfo; ++ ++ if (setxidinfo->mode != XT_SET_PACKET_XID) { ++ printk(KERN_WARNING "SETXID: unknown mode %u\n", ++ setxidinfo->mode); ++ return 0; ++ } ++ ++ return 1; ++} ++ ++static struct xt_target xt_setxid_target[] = { ++ { ++ .name = "SETXID", ++ .family = AF_INET, ++ .revision = 1, ++ .checkentry = checkentry_v1, ++ .target = target_v1, ++ .targetsize = sizeof(struct xt_setxid_target_info_v1), ++ .table = "mangle", ++ .me = THIS_MODULE, ++ } ++}; ++ ++static int __init init(void) ++{ ++ int err; ++ ++ err = xt_register_targets(xt_setxid_target, ARRAY_SIZE(xt_setxid_target)); ++ return err; ++} ++ ++static void __exit fini(void) ++{ ++ xt_unregister_targets(xt_setxid_target, ARRAY_SIZE(xt_setxid_target)); ++} ++ ++module_init(init); ++module_exit(fini); -- 2.47.0