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
49daee21
Commit
49daee21
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
[NETFILTER]: Avoid nesting readlocks in conntrack code.
parent
c6e56994
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
6 deletions
+7
-6
include/linux/netfilter_ipv4/ip_conntrack_core.h
include/linux/netfilter_ipv4/ip_conntrack_core.h
+1
-1
net/ipv4/netfilter/ip_conntrack_core.c
net/ipv4/netfilter/ip_conntrack_core.c
+2
-2
net/ipv4/netfilter/ip_conntrack_standalone.c
net/ipv4/netfilter/ip_conntrack_standalone.c
+3
-2
net/ipv4/netfilter/ip_nat_core.c
net/ipv4/netfilter/ip_nat_core.c
+1
-1
No files found.
include/linux/netfilter_ipv4/ip_conntrack_core.h
View file @
49daee21
...
...
@@ -17,7 +17,7 @@ extern void ip_conntrack_cleanup(void);
struct
ip_conntrack_protocol
;
extern
struct
ip_conntrack_protocol
*
ip_ct_find_proto
(
u_int8_t
protocol
);
/* Like above, but you already have conntrack read lock. */
extern
struct
ip_conntrack_protocol
*
__find_proto
(
u_int8_t
protocol
);
extern
struct
ip_conntrack_protocol
*
__
ip_ct_
find_proto
(
u_int8_t
protocol
);
extern
struct
list_head
protocol_list
;
/* Returns conntrack if it dealt with ICMP, and filled in skb->nfct */
...
...
net/ipv4/netfilter/ip_conntrack_core.c
View file @
49daee21
...
...
@@ -75,7 +75,7 @@ static inline int proto_cmpfn(const struct ip_conntrack_protocol *curr,
return
protocol
==
curr
->
proto
;
}
struct
ip_conntrack_protocol
*
__find_proto
(
u_int8_t
protocol
)
struct
ip_conntrack_protocol
*
__
ip_ct_
find_proto
(
u_int8_t
protocol
)
{
struct
ip_conntrack_protocol
*
p
;
...
...
@@ -93,7 +93,7 @@ struct ip_conntrack_protocol *ip_ct_find_proto(u_int8_t protocol)
struct
ip_conntrack_protocol
*
p
;
READ_LOCK
(
&
ip_conntrack_lock
);
p
=
__find_proto
(
protocol
);
p
=
__
ip_ct_
find_proto
(
protocol
);
READ_UNLOCK
(
&
ip_conntrack_lock
);
return
p
;
}
...
...
net/ipv4/netfilter/ip_conntrack_standalone.c
View file @
49daee21
...
...
@@ -71,7 +71,7 @@ print_expect(char *buffer, const struct ip_conntrack_expect *expect)
len
+=
sprintf
(
buffer
+
len
,
"use=%u proto=%u "
,
atomic_read
(
&
expect
->
use
),
expect
->
tuple
.
dst
.
protonum
);
len
+=
print_tuple
(
buffer
+
len
,
&
expect
->
tuple
,
__find_proto
(
expect
->
tuple
.
dst
.
protonum
));
__
ip_ct_
find_proto
(
expect
->
tuple
.
dst
.
protonum
));
len
+=
sprintf
(
buffer
+
len
,
"
\n
"
);
return
len
;
}
...
...
@@ -81,7 +81,7 @@ print_conntrack(char *buffer, const struct ip_conntrack *conntrack)
{
unsigned
int
len
;
struct
ip_conntrack_protocol
*
proto
=
__find_proto
(
conntrack
->
tuplehash
[
IP_CT_DIR_ORIGINAL
]
=
__
ip_ct_
find_proto
(
conntrack
->
tuplehash
[
IP_CT_DIR_ORIGINAL
]
.
tuple
.
dst
.
protonum
);
len
=
sprintf
(
buffer
,
"%-8s %u %lu "
,
...
...
@@ -361,6 +361,7 @@ EXPORT_SYMBOL(ip_conntrack_helper_unregister);
EXPORT_SYMBOL
(
ip_ct_selective_cleanup
);
EXPORT_SYMBOL
(
ip_ct_refresh
);
EXPORT_SYMBOL
(
ip_ct_find_proto
);
EXPORT_SYMBOL
(
__ip_ct_find_proto
);
EXPORT_SYMBOL
(
ip_ct_find_helper
);
EXPORT_SYMBOL
(
ip_conntrack_expect_related
);
EXPORT_SYMBOL
(
ip_conntrack_change_expect
);
...
...
net/ipv4/netfilter/ip_nat_core.c
View file @
49daee21
...
...
@@ -740,7 +740,7 @@ static inline int exp_for_packet(struct ip_conntrack_expect *exp,
int
ret
=
1
;
MUST_BE_READ_LOCKED
(
&
ip_conntrack_lock
);
proto
=
ip_ct_find_proto
((
*
pskb
)
->
nh
.
iph
->
protocol
);
proto
=
__
ip_ct_find_proto
((
*
pskb
)
->
nh
.
iph
->
protocol
);
if
(
proto
->
exp_matches_pkt
)
ret
=
proto
->
exp_matches_pkt
(
exp
,
pskb
);
...
...
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