Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
95aa1fe4
Commit
95aa1fe4
authored
Jul 16, 2009
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6
parents
b13bb2e9
941297f4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
6 deletions
+28
-6
Documentation/RCU/rculist_nulls.txt
Documentation/RCU/rculist_nulls.txt
+6
-1
MAINTAINERS
MAINTAINERS
+1
-0
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_core.c
+18
-3
net/netfilter/xt_osf.c
net/netfilter/xt_osf.c
+3
-2
No files found.
Documentation/RCU/rculist_nulls.txt
View file @
95aa1fe4
...
...
@@ -83,11 +83,12 @@ not detect it missed following items in original chain.
obj = kmem_cache_alloc(...);
lock_chain(); // typically a spin_lock()
obj->key = key;
atomic_inc(&obj->refcnt);
/*
* we need to make sure obj->key is updated before obj->next
* or obj->refcnt
*/
smp_wmb();
atomic_set(&obj->refcnt, 1);
hlist_add_head_rcu(&obj->obj_node, list);
unlock_chain(); // typically a spin_unlock()
...
...
@@ -159,6 +160,10 @@ out:
obj = kmem_cache_alloc(cachep);
lock_chain(); // typically a spin_lock()
obj->key = key;
/*
* changes to obj->key must be visible before refcnt one
*/
smp_wmb();
atomic_set(&obj->refcnt, 1);
/*
* insert obj in RCU way (readers might be traversing chain)
...
...
MAINTAINERS
View file @
95aa1fe4
...
...
@@ -4044,6 +4044,7 @@ L: netfilter@vger.kernel.org
L: coreteam@netfilter.org
W: http://www.netfilter.org/
W: http://www.iptables.org/
T: git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6.git
S: Supported
F: include/linux/netfilter*
F: include/linux/netfilter/
...
...
net/netfilter/nf_conntrack_core.c
View file @
95aa1fe4
...
...
@@ -561,23 +561,38 @@ struct nf_conn *nf_conntrack_alloc(struct net *net,
}
}
ct
=
kmem_cache_zalloc
(
nf_conntrack_cachep
,
gfp
);
/*
* Do not use kmem_cache_zalloc(), as this cache uses
* SLAB_DESTROY_BY_RCU.
*/
ct
=
kmem_cache_alloc
(
nf_conntrack_cachep
,
gfp
);
if
(
ct
==
NULL
)
{
pr_debug
(
"nf_conntrack_alloc: Can't alloc conntrack.
\n
"
);
atomic_dec
(
&
net
->
ct
.
count
);
return
ERR_PTR
(
-
ENOMEM
);
}
/*
* Let ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode.next
* and ct->tuplehash[IP_CT_DIR_REPLY].hnnode.next unchanged.
*/
memset
(
&
ct
->
tuplehash
[
IP_CT_DIR_MAX
],
0
,
sizeof
(
*
ct
)
-
offsetof
(
struct
nf_conn
,
tuplehash
[
IP_CT_DIR_MAX
]));
spin_lock_init
(
&
ct
->
lock
);
atomic_set
(
&
ct
->
ct_general
.
use
,
1
);
ct
->
tuplehash
[
IP_CT_DIR_ORIGINAL
].
tuple
=
*
orig
;
ct
->
tuplehash
[
IP_CT_DIR_ORIGINAL
].
hnnode
.
pprev
=
NULL
;
ct
->
tuplehash
[
IP_CT_DIR_REPLY
].
tuple
=
*
repl
;
ct
->
tuplehash
[
IP_CT_DIR_REPLY
].
hnnode
.
pprev
=
NULL
;
/* Don't set timer yet: wait for confirmation */
setup_timer
(
&
ct
->
timeout
,
death_by_timeout
,
(
unsigned
long
)
ct
);
#ifdef CONFIG_NET_NS
ct
->
ct_net
=
net
;
#endif
/*
* changes to lookup keys must be done before setting refcnt to 1
*/
smp_wmb
();
atomic_set
(
&
ct
->
ct_general
.
use
,
1
);
return
ct
;
}
EXPORT_SYMBOL_GPL
(
nf_conntrack_alloc
);
...
...
net/netfilter/xt_osf.c
View file @
95aa1fe4
...
...
@@ -330,7 +330,8 @@ static bool xt_osf_match_packet(const struct sk_buff *skb,
fcount
++
;
if
(
info
->
flags
&
XT_OSF_LOG
)
nf_log_packet
(
p
->
hooknum
,
0
,
skb
,
p
->
in
,
p
->
out
,
NULL
,
nf_log_packet
(
p
->
family
,
p
->
hooknum
,
skb
,
p
->
in
,
p
->
out
,
NULL
,
"%s [%s:%s] : %pi4:%d -> %pi4:%d hops=%d
\n
"
,
f
->
genre
,
f
->
version
,
f
->
subtype
,
&
ip
->
saddr
,
ntohs
(
tcp
->
source
),
...
...
@@ -345,7 +346,7 @@ static bool xt_osf_match_packet(const struct sk_buff *skb,
rcu_read_unlock
();
if
(
!
fcount
&&
(
info
->
flags
&
XT_OSF_LOG
))
nf_log_packet
(
p
->
hooknum
,
0
,
skb
,
p
->
in
,
p
->
out
,
NULL
,
nf_log_packet
(
p
->
family
,
p
->
hooknum
,
skb
,
p
->
in
,
p
->
out
,
NULL
,
"Remote OS is not known: %pi4:%u -> %pi4:%u
\n
"
,
&
ip
->
saddr
,
ntohs
(
tcp
->
source
),
&
ip
->
daddr
,
ntohs
(
tcp
->
dest
));
...
...
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