* [PATCH 1/2] conntrack: fix incomplete copying IPv6 addresses
@ 2005-12-25 7:36 Yasuyuki KOZAKAI
0 siblings, 0 replies; 2+ messages in thread
From: Yasuyuki KOZAKAI @ 2005-12-25 7:36 UTC (permalink / raw)
To: pablo; +Cc: netfilter-devel
[-- Attachment #1: 01-copy-addr.patch --]
[-- Type: Text/Plain, Size: 2348 bytes --]
[CONNTRACK] fix incomplete copying IPv6 addresses
If only addresses of orig(reply) tuple is specified, conntrack automatically
copy them to reply(orig) tuple. This fix makes conntrack possible to copy
IPv6 addresses correctly and set address family to invert tuple.
Signed-off-by: Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp>
---
commit dcc6b2fb1e018f7ceda135c731417ce92755bc77
tree 2c153fed854cee7253f8484bcf7a67b9f82c62bc
parent 7789192e0f5cfb4e8903be500880984c29c10b2c
author Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp> Sat, 24 Dec 2005 13:53:21 +0900
committer Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp> Sat, 24 Dec 2005 13:53:21 +0900
src/conntrack.c | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/conntrack.c b/src/conntrack.c
index 1160bf6..63d2757 100644
--- a/src/conntrack.c
+++ b/src/conntrack.c
@@ -912,12 +912,14 @@ int main(int argc, char *argv[])
case CT_CREATE:
if ((options & CT_OPT_ORIG)
&& !(options & CT_OPT_REPL)) {
- reply.src.v4 = orig.dst.v4;
- reply.dst.v4 = orig.src.v4;
+ reply.l3protonum = orig.l3protonum;
+ memcpy(&reply.src, &orig.dst, sizeof(reply.src));
+ memcpy(&reply.dst, &orig.src, sizeof(reply.dst));
} else if (!(options & CT_OPT_ORIG)
&& (options & CT_OPT_REPL)) {
- orig.src.v4 = reply.dst.v4;
- orig.dst.v4 = reply.src.v4;
+ orig.l3protonum = reply.l3protonum;
+ memcpy(&orig.src, &reply.dst, sizeof(orig.src));
+ memcpy(&orig.dst, &reply.src, sizeof(orig.dst));
}
if (options & CT_OPT_NATRANGE)
ct = nfct_conntrack_alloc(&orig, &reply, timeout,
@@ -963,12 +965,14 @@ int main(int argc, char *argv[])
case CT_UPDATE:
if ((options & CT_OPT_ORIG)
&& !(options & CT_OPT_REPL)) {
- reply.src.v4 = orig.dst.v4;
- reply.dst.v4 = orig.src.v4;
+ reply.l3protonum = orig.l3protonum;
+ memcpy(&reply.src, &orig.dst, sizeof(reply.src));
+ memcpy(&reply.dst, &orig.src, sizeof(reply.dst));
} else if (!(options & CT_OPT_ORIG)
&& (options & CT_OPT_REPL)) {
- orig.src.v4 = reply.dst.v4;
- orig.dst.v4 = reply.src.v4;
+ orig.l3protonum = reply.l3protonum;
+ memcpy(&orig.src, &reply.dst, sizeof(orig.src));
+ memcpy(&orig.dst, &reply.src, sizeof(orig.dst));
}
ct = nfct_conntrack_alloc(&orig, &reply, timeout,
&proto, status, mark, id,
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/2] conntrack: fix incomplete copying IPv6 addresses
[not found] <200512250736.jBP7abS5014776@toshiba.co.jp>
@ 2005-12-26 3:06 ` Pablo Neira Ayuso
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2005-12-26 3:06 UTC (permalink / raw)
To: Yasuyuki KOZAKAI; +Cc: netfilter-devel
Yasuyuki KOZAKAI wrote:
> [CONNTRACK] fix incomplete copying IPv6 addresses
>
> If only addresses of orig(reply) tuple is specified, conntrack automatically
> copy them to reply(orig) tuple. This fix makes conntrack possible to copy
> IPv6 addresses correctly and set address family to invert tuple.
Applied. Thanks.
--
Pablo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-12-26 3:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200512250736.jBP7abS5014776@toshiba.co.jp>
2005-12-26 3:06 ` [PATCH 1/2] conntrack: fix incomplete copying IPv6 addresses Pablo Neira Ayuso
2005-12-25 7:36 Yasuyuki KOZAKAI
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.