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
f2868da9
Commit
f2868da9
authored
Aug 13, 2004
by
Herbert Xu
Committed by
James Morris
Aug 13, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV4]: Fix race in inetdev RCU handling.
parent
1bffa251
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
include/linux/inetdevice.h
include/linux/inetdevice.h
+1
-7
net/ipv4/devinet.c
net/ipv4/devinet.c
+7
-1
No files found.
include/linux/inetdevice.h
View file @
f2868da9
...
...
@@ -158,16 +158,10 @@ __in_dev_get(const struct net_device *dev)
extern
void
in_dev_finish_destroy
(
struct
in_device
*
idev
);
static
inline
void
in_dev_rcu_destroy
(
struct
rcu_head
*
head
)
{
struct
in_device
*
idev
=
container_of
(
head
,
struct
in_device
,
rcu_head
);
in_dev_finish_destroy
(
idev
);
}
static
inline
void
in_dev_put
(
struct
in_device
*
idev
)
{
if
(
atomic_dec_and_test
(
&
idev
->
refcnt
))
call_rcu
(
&
idev
->
rcu_head
,
in_dev_rcu_destroy
);
in_dev_finish_destroy
(
idev
);
}
#define __in_dev_put(idev) atomic_dec(&(idev)->refcnt)
...
...
net/ipv4/devinet.c
View file @
f2868da9
...
...
@@ -177,6 +177,12 @@ struct in_device *inetdev_init(struct net_device *dev)
goto
out
;
}
static
void
in_dev_rcu_put
(
struct
rcu_head
*
head
)
{
struct
in_device
*
idev
=
container_of
(
head
,
struct
in_device
,
rcu_head
);
in_dev_put
(
idev
);
}
static
void
inetdev_destroy
(
struct
in_device
*
in_dev
)
{
struct
in_ifaddr
*
ifa
;
...
...
@@ -204,7 +210,7 @@ static void inetdev_destroy(struct in_device *in_dev)
neigh_sysctl_unregister
(
in_dev
->
arp_parms
);
#endif
neigh_parms_release
(
&
arp_tbl
,
in_dev
->
arp_parms
);
in_dev_put
(
in_dev
);
call_rcu
(
&
in_dev
->
rcu_head
,
in_dev_rcu_put
);
}
int
inet_addr_onlink
(
struct
in_device
*
in_dev
,
u32
a
,
u32
b
)
...
...
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