netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Leblond <eric@inl.fr>
To: netfilter-devel@vger.kernel.org
Cc: Laurent Licour <laurent@licour.com>, Eric Leblond <eric@inl.fr>
Subject: [PATCH 1/2] netfilter: nfmark routing in OUTPUT, mangle, NFQUEUE
Date: Mon, 24 Nov 2008 21:46:46 +0100	[thread overview]
Message-ID: <1227559607-3077-2-git-send-email-eric@inl.fr> (raw)
In-Reply-To: <1227559607-3077-1-git-send-email-eric@inl.fr>

From: Laurent Licour <laurent@licour.com>

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.

Signed-off-by: Eric Leblond <eric@inl.fr>
---
 net/ipv4/netfilter.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/netfilter.c b/net/ipv4/netfilter.c
index 6efdb70..3f2fc81 100644
--- a/net/ipv4/netfilter.c
+++ b/net/ipv4/netfilter.c
@@ -125,6 +125,7 @@ struct ip_rt_info {
 	__be32 daddr;
 	__be32 saddr;
 	u_int8_t tos;
+	__u32 mark;
 };
 
 static void nf_ip_saveroute(const struct sk_buff *skb,
@@ -138,6 +139,7 @@ static void nf_ip_saveroute(const struct sk_buff *skb,
 		rt_info->tos = iph->tos;
 		rt_info->daddr = iph->daddr;
 		rt_info->saddr = iph->saddr;
+		rt_info->mark = skb->mark;
 	}
 }
 
@@ -150,6 +152,7 @@ static int nf_ip_reroute(struct sk_buff *skb,
 		const struct iphdr *iph = ip_hdr(skb);
 
 		if (!(iph->tos == rt_info->tos
+		      && skb->mark == rt_info->mark
 		      && iph->daddr == rt_info->daddr
 		      && iph->saddr == rt_info->saddr))
 			return ip_route_me_harder(skb, RTN_UNSPEC);
-- 
1.5.6.3


  reply	other threads:[~2008-11-24 20:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-24 20:46 [PATCH 0/2] routing via nfmark in OUTPUT NFQUEUE Eric Leblond
2008-11-24 20:46 ` Eric Leblond [this message]
2008-11-25 11:17   ` [PATCH 1/2] netfilter: nfmark routing in OUTPUT, mangle, NFQUEUE Patrick McHardy
2008-11-24 20:46 ` [PATCH 2/2] netfilter: nfmark IPV6 " Eric Leblond
2008-11-25 11:18   ` Patrick McHardy

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=1227559607-3077-2-git-send-email-eric@inl.fr \
    --to=eric@inl.fr \
    --cc=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;
as well as URLs for NNTP newsgroup(s).