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
ee639b13
Commit
ee639b13
authored
Apr 27, 2003
by
Arnaldo Carvalho de Melo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
o net/socket: make sys_accept bump the net proto family module usage count
Thanks to Max Krasnyansky for spotting this.
parent
24f91a19
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
net/socket.c
net/socket.c
+10
-5
No files found.
net/socket.c
View file @
ee639b13
...
...
@@ -1288,24 +1288,28 @@ asmlinkage long sys_accept(int fd, struct sockaddr *upeer_sockaddr, int *upeer_a
if
(
err
)
goto
out_release
;
err
=
-
EBUSY
;
if
(
!
net_family_get
(
sock
->
ops
->
family
))
goto
out_release
;
err
=
sock
->
ops
->
accept
(
sock
,
newsock
,
sock
->
file
->
f_flags
);
if
(
err
<
0
)
goto
out_
release
;
goto
out_
family_put
;
if
(
upeer_sockaddr
)
{
if
(
newsock
->
ops
->
getname
(
newsock
,
(
struct
sockaddr
*
)
address
,
&
len
,
2
)
<
0
)
{
err
=
-
ECONNABORTED
;
goto
out_
release
;
goto
out_
family_put
;
}
err
=
move_addr_to_user
(
address
,
len
,
upeer_sockaddr
,
upeer_addrlen
);
if
(
err
<
0
)
goto
out_
release
;
goto
out_
family_put
;
}
/* File flags are not inherited via accept() unlike another OSes. */
if
((
err
=
sock_map_fd
(
newsock
))
<
0
)
goto
out_
release
;
goto
out_
family_put
;
security_socket_post_accept
(
sock
,
newsock
);
...
...
@@ -1313,7 +1317,8 @@ asmlinkage long sys_accept(int fd, struct sockaddr *upeer_sockaddr, int *upeer_a
sockfd_put
(
sock
);
out:
return
err
;
out_family_put:
net_family_put
(
sock
->
ops
->
family
);
out_release:
sock_release
(
newsock
);
goto
out_put
;
...
...
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