Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
280a827a
Commit
280a827a
authored
Oct 02, 2003
by
Harald Welte
Committed by
Stephen Hemminger
Oct 02, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NETFILTER]: Fix SO_ORIGINAL_DST, broken by earlier endianness fixes.
parent
49448a2f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
include/linux/netfilter_ipv4/ip_conntrack_tuple.h
include/linux/netfilter_ipv4/ip_conntrack_tuple.h
+8
-0
net/ipv4/netfilter/ip_conntrack_core.c
net/ipv4/netfilter/ip_conntrack_core.c
+8
-5
No files found.
include/linux/netfilter_ipv4/ip_conntrack_tuple.h
View file @
280a827a
...
@@ -62,6 +62,14 @@ struct ip_conntrack_tuple
...
@@ -62,6 +62,14 @@ struct ip_conntrack_tuple
}
dst
;
}
dst
;
};
};
/* This is optimized opposed to a memset of the whole structure. Everything we
* really care about is the source/destination unions */
#define IP_CT_TUPLE_U_BLANK(tuple) \
do { \
(tuple)->src.u.all = 0; \
(tuple)->dst.u.all = 0; \
} while (0)
enum
ip_conntrack_dir
enum
ip_conntrack_dir
{
{
IP_CT_DIR_ORIGINAL
,
IP_CT_DIR_ORIGINAL
,
...
...
net/ipv4/netfilter/ip_conntrack_core.c
View file @
280a827a
...
@@ -1279,11 +1279,14 @@ getorigdst(struct sock *sk, int optval, void *user, int *len)
...
@@ -1279,11 +1279,14 @@ getorigdst(struct sock *sk, int optval, void *user, int *len)
{
{
struct
inet_opt
*
inet
=
inet_sk
(
sk
);
struct
inet_opt
*
inet
=
inet_sk
(
sk
);
struct
ip_conntrack_tuple_hash
*
h
;
struct
ip_conntrack_tuple_hash
*
h
;
struct
ip_conntrack_tuple
tuple
=
{
{
inet
->
rcv_saddr
,
struct
ip_conntrack_tuple
tuple
;
{
.
tcp
=
{
inet
->
sport
}
}
},
{
inet
->
daddr
,
IP_CT_TUPLE_U_BLANK
(
&
tuple
);
{
.
tcp
=
{
inet
->
dport
}
},
tuple
.
src
.
ip
=
inet
->
rcv_saddr
;
IPPROTO_TCP
}
};
tuple
.
src
.
u
.
tcp
.
port
=
inet
->
sport
;
tuple
.
dst
.
ip
=
inet
->
daddr
;
tuple
.
dst
.
u
.
tcp
.
port
=
inet
->
dport
;
tuple
.
dst
.
protonum
=
IPPROTO_TCP
;
/* We only do TCP at the moment: is there a better way? */
/* We only do TCP at the moment: is there a better way? */
if
(
strcmp
(
sk
->
sk_prot
->
name
,
"TCP"
))
{
if
(
strcmp
(
sk
->
sk_prot
->
name
,
"TCP"
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment