Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.osdl.org>2004-02-13 16:15:17 -0800
committerLinus Torvalds <torvalds@home.osdl.org>2004-02-13 16:15:17 -0800
commitab091fe759aee5d2d00f675e42f3fa7d412563da (patch)
tree08a1f57648984e8e833428c2f1720f08a84c8dd3
parentef146c9ba960b460442addc86b51c24643532630 (diff)
parentc54c4df5211e0c106cca06f4b74faf8024a63e4c (diff)
Merge bk://kernel.bkbits.net/davem/sctp-2.6
into home.osdl.org:/home/torvalds/v2.5/linux
-rw-r--r--net/sctp/socket.c17
-rw-r--r--net/sctp/ssnmap.c10
2 files changed, 23 insertions, 4 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 4f7cbfe0e36c..8062d2a984af 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -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(&sctp_sk(sk)->initmsg, optval, optlen))
+ if (copy_from_user(&sinit, 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;
diff --git a/net/sctp/ssnmap.c b/net/sctp/ssnmap.c
index 345ab7120e8d..f907f9a8c31a 100644
--- a/net/sctp/ssnmap.c
+++ b/net/sctp/ssnmap.c
@@ -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);
}
}