All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: "David S. Miller" <davem@davemloft.net>
Cc: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>
Subject: [PATCH 1/4]: Fix SNAT/DNAT target size checks
Date: Tue, 25 Jan 2005 05:48:07 +0100	[thread overview]
Message-ID: <41F5CF87.50208@trash.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: 01.diff --]
[-- Type: text/x-patch, Size: 1925 bytes --]

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/01/25 03:56:48+01:00 gandalf@wlug.westbo.se 
#   [NETFILTER]: Fix SNAT/DNAT target size checks
#   
#   This patch fixes two size checks in the checkentry() for SNAT and DNAT
#   targets. The patch to remove support for multiple ranges forgot to use
#   IPT_ALIGN(). This isn't a problem on x86 but other archs like parisc
#   are affected and thus can't add any SNAT/DNAT rules.
#   
#   Signed-off-by: Martin Josefsson <gandalf@wlug.westbo.se>
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
# 
# net/ipv4/netfilter/ip_nat_rule.c
#   2005/01/25 03:56:39+01:00 gandalf@wlug.westbo.se +2 -2
#   [NETFILTER]: Fix SNAT/DNAT target size checks
#   
#   This patch fixes two size checks in the checkentry() for SNAT and DNAT
#   targets. The patch to remove support for multiple ranges forgot to use
#   IPT_ALIGN(). This isn't a problem on x86 but other archs like parisc
#   are affected and thus can't add any SNAT/DNAT rules.
#   
#   Signed-off-by: Martin Josefsson <gandalf@wlug.westbo.se>
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
# 
diff -Nru a/net/ipv4/netfilter/ip_nat_rule.c b/net/ipv4/netfilter/ip_nat_rule.c
--- a/net/ipv4/netfilter/ip_nat_rule.c	2005-01-25 04:37:00 +01:00
+++ b/net/ipv4/netfilter/ip_nat_rule.c	2005-01-25 04:37:00 +01:00
@@ -181,7 +181,7 @@
 		return 0;
 	}
 
-	if (targinfosize != sizeof(struct ip_nat_multi_range_compat)) {
+	if (targinfosize != IPT_ALIGN(sizeof(struct ip_nat_multi_range_compat))) {
 		DEBUGP("SNAT: Target size %u wrong for %u ranges\n",
 		       targinfosize, mr->rangesize);
 		return 0;
@@ -214,7 +214,7 @@
 		return 0;
 	}
 
-	if (targinfosize != sizeof(struct ip_nat_multi_range_compat)) {
+	if (targinfosize != IPT_ALIGN(sizeof(struct ip_nat_multi_range_compat))) {
 		DEBUGP("DNAT: Target size %u wrong for %u ranges\n",
 		       targinfosize, mr->rangesize);
 		return 0;

                 reply	other threads:[~2005-01-25  4:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=41F5CF87.50208@trash.net \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=netfilter-devel@lists.netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.