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
nexedi
linux
Commits
74447771
Commit
74447771
authored
May 06, 2003
by
Stephen Hemminger
Committed by
David S. Miller
May 06, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV4]: Replace explicit dev->refcount bumps with dev_hold.
parent
c76cc6e2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
net/ipv4/fib_frontend.c
net/ipv4/fib_frontend.c
+2
-2
net/ipv4/fib_semantics.c
net/ipv4/fib_semantics.c
+3
-3
No files found.
net/ipv4/fib_frontend.c
View file @
74447771
...
...
@@ -115,9 +115,9 @@ struct net_device * ip_dev_find(u32 addr)
if
(
res
.
type
!=
RTN_LOCAL
)
goto
out
;
dev
=
FIB_RES_DEV
(
res
);
if
(
dev
)
atomic_inc
(
&
dev
->
refcnt
);
if
(
dev
)
dev_hold
(
dev
);
out:
fib_res_put
(
&
res
);
return
dev
;
...
...
net/ipv4/fib_semantics.c
View file @
74447771
...
...
@@ -406,7 +406,7 @@ static int fib_check_nh(const struct rtmsg *r, struct fib_info *fi, struct fib_n
if
(
!
(
dev
->
flags
&
IFF_UP
))
return
-
ENETDOWN
;
nh
->
nh_dev
=
dev
;
atomic_inc
(
&
dev
->
refcnt
);
dev_hold
(
dev
);
nh
->
nh_scope
=
RT_SCOPE_LINK
;
return
0
;
}
...
...
@@ -429,7 +429,7 @@ static int fib_check_nh(const struct rtmsg *r, struct fib_info *fi, struct fib_n
nh
->
nh_oif
=
FIB_RES_OIF
(
res
);
if
((
nh
->
nh_dev
=
FIB_RES_DEV
(
res
))
==
NULL
)
goto
out
;
atomic_inc
(
&
nh
->
nh_dev
->
refcnt
);
dev_hold
(
nh
->
nh_dev
);
err
=
-
ENETDOWN
;
if
(
!
(
nh
->
nh_dev
->
flags
&
IFF_UP
))
goto
out
;
...
...
@@ -451,7 +451,7 @@ static int fib_check_nh(const struct rtmsg *r, struct fib_info *fi, struct fib_n
return
-
ENETDOWN
;
}
nh
->
nh_dev
=
in_dev
->
dev
;
atomic_inc
(
&
nh
->
nh_dev
->
refcnt
);
dev_hold
(
nh
->
nh_dev
);
nh
->
nh_scope
=
RT_SCOPE_HOST
;
in_dev_put
(
in_dev
);
}
...
...
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