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
c54c4df5
Commit
c54c4df5
authored
Feb 13, 2004
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge davem@nuts.davemloft.net:/disk1/BK/sctp-2.6
into kernel.bkbits.net:/home/davem/sctp-2.6
parents
d1c0dfc8
307be3f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
4 deletions
+23
-4
net/sctp/socket.c
net/sctp/socket.c
+16
-1
net/sctp/ssnmap.c
net/sctp/ssnmap.c
+7
-3
No files found.
net/sctp/socket.c
View file @
c54c4df5
...
...
@@ -1683,10 +1683,23 @@ static int sctp_setsockopt_peer_addr_params(struct sock *sk,
*/
static
int
sctp_setsockopt_initmsg
(
struct
sock
*
sk
,
char
*
optval
,
int
optlen
)
{
struct
sctp_initmsg
sinit
;
struct
sctp_opt
*
sp
=
sctp_sk
(
sk
);
if
(
optlen
!=
sizeof
(
struct
sctp_initmsg
))
return
-
EINVAL
;
if
(
copy_from_user
(
&
s
ctp_sk
(
sk
)
->
initmsg
,
optval
,
optlen
))
if
(
copy_from_user
(
&
s
init
,
optval
,
optlen
))
return
-
EFAULT
;
if
(
sinit
.
sinit_num_ostreams
)
sp
->
initmsg
.
sinit_num_ostreams
=
sinit
.
sinit_num_ostreams
;
if
(
sinit
.
sinit_max_instreams
)
sp
->
initmsg
.
sinit_max_instreams
=
sinit
.
sinit_max_instreams
;
if
(
sinit
.
sinit_max_attempts
)
sp
->
initmsg
.
sinit_max_attempts
=
sinit
.
sinit_max_attempts
;
if
(
sinit
.
sinit_max_init_timeo
)
sp
->
initmsg
.
sinit_max_init_timeo
=
sinit
.
sinit_max_init_timeo
;
return
0
;
}
...
...
@@ -2880,6 +2893,7 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len,
memcpy
(
&
temp
,
&
from
->
ipaddr
,
sizeof
(
temp
));
sctp_get_pf_specific
(
sk
->
sk_family
)
->
addr_v4map
(
sp
,
&
temp
);
addrlen
=
sctp_get_af_specific
(
sk
->
sk_family
)
->
sockaddr_len
;
temp
.
v4
.
sin_port
=
htons
(
temp
.
v4
.
sin_port
);
if
(
copy_to_user
(
to
,
&
temp
,
addrlen
))
return
-
EFAULT
;
to
+=
addrlen
;
...
...
@@ -2974,6 +2988,7 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len,
memcpy
(
&
temp
,
&
from
->
a
,
sizeof
(
temp
));
sctp_get_pf_specific
(
sk
->
sk_family
)
->
addr_v4map
(
sp
,
&
temp
);
addrlen
=
sctp_get_af_specific
(
temp
.
sa
.
sa_family
)
->
sockaddr_len
;
temp
.
v4
.
sin_port
=
htons
(
temp
.
v4
.
sin_port
);
if
(
copy_to_user
(
to
,
&
temp
,
addrlen
))
return
-
EFAULT
;
to
+=
addrlen
;
...
...
net/sctp/ssnmap.c
View file @
c54c4df5
...
...
@@ -56,8 +56,10 @@ static inline size_t sctp_ssnmap_size(__u16 in, __u16 out)
struct
sctp_ssnmap
*
sctp_ssnmap_new
(
__u16
in
,
__u16
out
,
int
gfp
)
{
struct
sctp_ssnmap
*
retval
;
int
order
;
retval
=
kmalloc
(
sctp_ssnmap_size
(
in
,
out
),
gfp
);
order
=
get_order
(
sctp_ssnmap_size
(
in
,
out
));
retval
=
(
struct
sctp_ssnmap
*
)
__get_free_pages
(
gfp
,
order
);
if
(
!
retval
)
goto
fail
;
...
...
@@ -71,7 +73,7 @@ struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out, int gfp)
return
retval
;
fail_map:
kfree
(
retval
);
free_pages
((
unsigned
long
)
retval
,
order
);
fail:
return
NULL
;
}
...
...
@@ -107,7 +109,9 @@ void sctp_ssnmap_clear(struct sctp_ssnmap *map)
void
sctp_ssnmap_free
(
struct
sctp_ssnmap
*
map
)
{
if
(
map
&&
map
->
malloced
)
{
kfree
(
map
);
free_pages
((
unsigned
long
)
map
,
get_order
(
sctp_ssnmap_size
(
map
->
in
.
len
,
map
->
out
.
len
)));
SCTP_DBG_OBJCNT_DEC
(
ssnmap
);
}
}
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