]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
xt_TEE: enable routing by iif, nfmark and flowlabel
authorJan Engelhardt <jengelh@medozas.de>
Sat, 7 Mar 2009 00:20:39 +0000 (01:20 +0100)
committerJan Engelhardt <jengelh@medozas.de>
Sat, 7 Mar 2009 00:27:08 +0000 (01:27 +0100)
Patrick McHardy suggests in
http://marc.info/?l=netfilter-devel&m=123564267330117&w=2 that
routing should handle the clone more like its original.

doc/changelog.txt
extensions/xt_TEE.c

index e1f8d536090636b08717ebb3154eaa899c690ec3..656de9ac1c89939111e0f975cd3ccc5fcb9ac30c 100644 (file)
@@ -6,6 +6,7 @@
 - xt_LOGMARK: print incoming interface index
 - revert "TEE: do not use TOS for routing"
 - xt_TEE: resolve unknown symbol error with CONFIG_IPV6=n
+- xt_TEE: enable routing by iif, nfmark and flowlabel
 
 
 Xtables-addons 1.10 (February 18 2009)
index 4bac6822fa89c1791ce39492e2daa341ea4744b2..f24785dcda87c8419179946c0776d2abd5fc6792 100644 (file)
@@ -60,6 +60,8 @@ tee_tg_route4(struct sk_buff *skb, const struct xt_tee_tginfo *info)
        struct flowi fl;
 
        memset(&fl, 0, sizeof(fl));
+       fl.iif  = skb->iif;
+       fl.mark = skb->mark;
        fl.nl_u.ip4_u.daddr = info->gw.ip;
        fl.nl_u.ip4_u.tos   = RT_TOS(iph->tos);
        fl.nl_u.ip4_u.scope = RT_SCOPE_UNIVERSE;
@@ -219,11 +221,16 @@ tee_tg4(struct sk_buff **pskb, const struct xt_target_param *par)
 static bool
 tee_tg_route6(struct sk_buff *skb, const struct xt_tee_tginfo *info)
 {
+       const struct ipv6hdr *iph = ipv6_hdr(skb);
        struct dst_entry *dst;
        struct flowi fl;
 
        memset(&fl, 0, sizeof(fl));
+       fl.iif  = skb->iif;
+       fl.mark = skb->mark;
        fl.nl_u.ip6_u.daddr = info->gw.in6;
+       fl.nl_u.ip6_u.flowlabel = ((iph->flow_lbl[0] & 0xF) << 16) |
+               (iph->flow_lbl[1] << 8) | iph->flow_lbl[2];
 
 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 25)
        dst = ip6_route_output(NULL, &fl);