From: Laurent Licour <laurent@licour.com>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH] netfilter : nfmark routing in OUTPUT, mangle, NFQUEUE
Date: Thu, 10 Jul 2008 07:45:32 +0200 [thread overview]
Message-ID: <4875A1FC.8050705@licour.com> (raw)
This patch let nfmark to be evaluated for routing decision for OUTPUT
packet, in mangle
table, when process paquet in NFQUEUE
Until now, only change (in NFQUEUE process) on fields src_addr,
dest_addr and tos
could make netfilter to reevalute the routing.
Similar code could also be applied to ipv6 code...
--- linux-2.6.18.i386.ori/net/ipv4/netfilter.c 2006-09-20
05:42:06.000000000 +0200
+++ linux-2.6.18.i386/net/ipv4/netfilter.c 2008-07-07
02:04:34.000000000 +0200
@@ -131,6 +131,9 @@
u_int32_t daddr;
u_int32_t saddr;
u_int8_t tos;
+#ifdef CONFIG_IP_ROUTE_FWMARK
+ __u32 nfmark;
+#endif
};
static void nf_ip_saveroute(const struct sk_buff *skb, struct nf_info
*info)
@@ -143,6 +146,9 @@
rt_info->tos = iph->tos;
rt_info->daddr = iph->daddr;
rt_info->saddr = iph->saddr;
+#ifdef CONFIG_IP_ROUTE_FWMARK
+ rt_info->nfmark = skb->nfmark;
+#endif
}
}
@@ -154,6 +160,9 @@
struct iphdr *iph = (*pskb)->nh.iph;
if (!(iph->tos == rt_info->tos
+#ifdef CONFIG_IP_ROUTE_FWMARK
+ && (*pskb)->nfmark == rt_info->nfmark
+#endif
&& iph->daddr == rt_info->daddr
&& iph->saddr == rt_info->saddr))
return ip_route_me_harder(pskb);
next reply other threads:[~2008-07-10 5:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-10 5:45 Laurent Licour [this message]
2008-07-15 10:26 ` [PATCH] netfilter : nfmark routing in OUTPUT, mangle, NFQUEUE Patrick McHardy
2008-07-17 8:00 ` Laurent Licour
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4875A1FC.8050705@licour.com \
--to=laurent@licour.com \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox