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
c6e56994
Commit
c6e56994
authored
Oct 13, 2002
by
Harald Welte
Committed by
David S. Miller
Oct 13, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net/ipv4/netfilter/ip_conntrack_core.c: Fix ip_conntrack_change_expect locking.
parent
1fc9d1fb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
net/ipv4/netfilter/ip_conntrack_core.c
net/ipv4/netfilter/ip_conntrack_core.c
+9
-7
No files found.
net/ipv4/netfilter/ip_conntrack_core.c
View file @
c6e56994
...
@@ -1061,7 +1061,10 @@ int ip_conntrack_expect_related(struct ip_conntrack *related_to,
...
@@ -1061,7 +1061,10 @@ int ip_conntrack_expect_related(struct ip_conntrack *related_to,
int
ip_conntrack_change_expect
(
struct
ip_conntrack_expect
*
expect
,
int
ip_conntrack_change_expect
(
struct
ip_conntrack_expect
*
expect
,
struct
ip_conntrack_tuple
*
newtuple
)
struct
ip_conntrack_tuple
*
newtuple
)
{
{
int
ret
;
MUST_BE_READ_LOCKED
(
&
ip_conntrack_lock
);
MUST_BE_READ_LOCKED
(
&
ip_conntrack_lock
);
WRITE_LOCK
(
&
ip_conntrack_expect_tuple_lock
);
DEBUGP
(
"change_expect:
\n
"
);
DEBUGP
(
"change_expect:
\n
"
);
DEBUGP
(
"exp tuple: "
);
DUMP_TUPLE
(
&
expect
->
tuple
);
DEBUGP
(
"exp tuple: "
);
DUMP_TUPLE
(
&
expect
->
tuple
);
...
@@ -1074,26 +1077,25 @@ int ip_conntrack_change_expect(struct ip_conntrack_expect *expect,
...
@@ -1074,26 +1077,25 @@ int ip_conntrack_change_expect(struct ip_conntrack_expect *expect,
&&
LIST_FIND
(
&
ip_conntrack_expect_list
,
expect_clash
,
&&
LIST_FIND
(
&
ip_conntrack_expect_list
,
expect_clash
,
struct
ip_conntrack_expect
*
,
newtuple
,
&
expect
->
mask
))
{
struct
ip_conntrack_expect
*
,
newtuple
,
&
expect
->
mask
))
{
/* Force NAT to find an unused tuple */
/* Force NAT to find an unused tuple */
ret
urn
-
1
;
ret
=
-
1
;
}
else
{
}
else
{
WRITE_LOCK
(
&
ip_conntrack_expect_tuple_lock
);
memcpy
(
&
expect
->
ct_tuple
,
&
expect
->
tuple
,
sizeof
(
expect
->
tuple
));
memcpy
(
&
expect
->
ct_tuple
,
&
expect
->
tuple
,
sizeof
(
expect
->
tuple
));
memcpy
(
&
expect
->
tuple
,
newtuple
,
sizeof
(
expect
->
tuple
));
memcpy
(
&
expect
->
tuple
,
newtuple
,
sizeof
(
expect
->
tuple
));
WRITE_UNLOCK
(
&
ip_conntrack_expect_tuple_lock
);
ret
=
0
;
return
0
;
}
}
}
else
{
}
else
{
/* Resent packet */
/* Resent packet */
DEBUGP
(
"change expect: resent packet
\n
"
);
DEBUGP
(
"change expect: resent packet
\n
"
);
if
(
ip_ct_tuple_equal
(
&
expect
->
tuple
,
newtuple
))
{
if
(
ip_ct_tuple_equal
(
&
expect
->
tuple
,
newtuple
))
{
ret
urn
0
;
ret
=
0
;
}
else
{
}
else
{
/* Force NAT to choose again the same port */
/* Force NAT to choose again the same port */
ret
urn
-
1
;
ret
=
-
1
;
}
}
}
}
WRITE_UNLOCK
(
&
ip_conntrack_expect_tuple_lock
);
return
-
1
;
return
ret
;
}
}
/* Alter reply tuple (maybe alter helper). If it's already taken,
/* Alter reply tuple (maybe alter helper). If it's already taken,
...
...
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