aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2008-03-01 13:29:55 -0500
committerSteve French <sfrench@us.ibm.com>2008-03-01 13:29:55 -0500
commit0dbd888936a23514716b8d944775bc56f731363a (patch)
treea2c60cdc45bdcbed47680731fa8188bffe58c098 /net/sctp
parent0b442d2c28479332610c46e1a74e5638ab63a97d (diff)
parentd395991c117d43bfca97101a931a41d062a93852 (diff)
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/auth.c4
-rw-r--r--net/sctp/ipv6.c12
-rw-r--r--net/sctp/objcnt.c5
-rw-r--r--net/sctp/proc.c4
-rw-r--r--net/sctp/protocol.c12
-rw-r--r--net/sctp/socket.c20
-rw-r--r--net/sctp/ulpevent.c2
7 files changed, 33 insertions, 26 deletions
diff --git a/net/sctp/auth.c b/net/sctp/auth.c
index 8bb79f281774..675a5c3e68a6 100644
--- a/net/sctp/auth.c
+++ b/net/sctp/auth.c
@@ -838,11 +838,11 @@ int sctp_auth_set_key(struct sctp_endpoint *ep,
838 } 838 }
839 839
840 /* Create a new key data based on the info passed in */ 840 /* Create a new key data based on the info passed in */
841 key = sctp_auth_create_key(auth_key->sca_keylen, GFP_KERNEL); 841 key = sctp_auth_create_key(auth_key->sca_keylength, GFP_KERNEL);
842 if (!key) 842 if (!key)
843 goto nomem; 843 goto nomem;
844 844
845 memcpy(key->data, &auth_key->sca_key[0], auth_key->sca_keylen); 845 memcpy(key->data, &auth_key->sca_key[0], auth_key->sca_keylength);
846 846
847 /* If we are replacing, remove the old keys data from the 847 /* If we are replacing, remove the old keys data from the
848 * key id. If we are adding new key id, add it to the 848 * key id. If we are adding new key id, add it to the
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 4d7ec961ae1d..87f940587d5f 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -966,7 +966,7 @@ static struct inet6_protocol sctpv6_protocol = {
966 .flags = INET6_PROTO_NOPOLICY | INET6_PROTO_FINAL, 966 .flags = INET6_PROTO_NOPOLICY | INET6_PROTO_FINAL,
967}; 967};
968 968
969static struct sctp_af sctp_ipv6_specific = { 969static struct sctp_af sctp_af_inet6 = {
970 .sa_family = AF_INET6, 970 .sa_family = AF_INET6,
971 .sctp_xmit = sctp_v6_xmit, 971 .sctp_xmit = sctp_v6_xmit,
972 .setsockopt = ipv6_setsockopt, 972 .setsockopt = ipv6_setsockopt,
@@ -998,7 +998,7 @@ static struct sctp_af sctp_ipv6_specific = {
998#endif 998#endif
999}; 999};
1000 1000
1001static struct sctp_pf sctp_pf_inet6_specific = { 1001static struct sctp_pf sctp_pf_inet6 = {
1002 .event_msgname = sctp_inet6_event_msgname, 1002 .event_msgname = sctp_inet6_event_msgname,
1003 .skb_msgname = sctp_inet6_skb_msgname, 1003 .skb_msgname = sctp_inet6_skb_msgname,
1004 .af_supported = sctp_inet6_af_supported, 1004 .af_supported = sctp_inet6_af_supported,
@@ -1008,7 +1008,7 @@ static struct sctp_pf sctp_pf_inet6_specific = {
1008 .supported_addrs = sctp_inet6_supported_addrs, 1008 .supported_addrs = sctp_inet6_supported_addrs,
1009 .create_accept_sk = sctp_v6_create_accept_sk, 1009 .create_accept_sk = sctp_v6_create_accept_sk,
1010 .addr_v4map = sctp_v6_addr_v4map, 1010 .addr_v4map = sctp_v6_addr_v4map,
1011 .af = &sctp_ipv6_specific, 1011 .af = &sctp_af_inet6,
1012}; 1012};
1013 1013
1014/* Initialize IPv6 support and register with socket layer. */ 1014/* Initialize IPv6 support and register with socket layer. */
@@ -1017,10 +1017,10 @@ int sctp_v6_init(void)
1017 int rc; 1017 int rc;
1018 1018
1019 /* Register the SCTP specific PF_INET6 functions. */ 1019 /* Register the SCTP specific PF_INET6 functions. */
1020 sctp_register_pf(&sctp_pf_inet6_specific, PF_INET6); 1020 sctp_register_pf(&sctp_pf_inet6, PF_INET6);
1021 1021
1022 /* Register the SCTP specific AF_INET6 functions. */ 1022 /* Register the SCTP specific AF_INET6 functions. */
1023 sctp_register_af(&sctp_ipv6_specific); 1023 sctp_register_af(&sctp_af_inet6);
1024 1024
1025 rc = proto_register(&sctpv6_prot, 1); 1025 rc = proto_register(&sctpv6_prot, 1);
1026 if (rc) 1026 if (rc)
@@ -1051,7 +1051,7 @@ void sctp_v6_exit(void)
1051 inet6_unregister_protosw(&sctpv6_seqpacket_protosw); 1051 inet6_unregister_protosw(&sctpv6_seqpacket_protosw);
1052 inet6_unregister_protosw(&sctpv6_stream_protosw); 1052 inet6_unregister_protosw(&sctpv6_stream_protosw);
1053 proto_unregister(&sctpv6_prot); 1053 proto_unregister(&sctpv6_prot);
1054 list_del(&sctp_ipv6_specific.list); 1054 list_del(&sctp_af_inet6.list);
1055} 1055}
1056 1056
1057/* Unregister with inet6 layer. */ 1057/* Unregister with inet6 layer. */
diff --git a/net/sctp/objcnt.c b/net/sctp/objcnt.c
index 14e294e37626..cfeb07ea1b04 100644
--- a/net/sctp/objcnt.c
+++ b/net/sctp/objcnt.c
@@ -132,12 +132,11 @@ void sctp_dbg_objcnt_init(void)
132{ 132{
133 struct proc_dir_entry *ent; 133 struct proc_dir_entry *ent;
134 134
135 ent = create_proc_entry("sctp_dbg_objcnt", 0, proc_net_sctp); 135 ent = proc_create("sctp_dbg_objcnt", 0,
136 proc_net_sctp, &sctp_objcnt_ops);
136 if (!ent) 137 if (!ent)
137 printk(KERN_WARNING 138 printk(KERN_WARNING
138 "sctp_dbg_objcnt: Unable to create /proc entry.\n"); 139 "sctp_dbg_objcnt: Unable to create /proc entry.\n");
139 else
140 ent->proc_fops = &sctp_objcnt_ops;
141} 140}
142 141
143/* Cleanup the objcount entry in the proc filesystem. */ 142/* Cleanup the objcount entry in the proc filesystem. */
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index 69bb5a63fd8b..9e214da82d9e 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -108,12 +108,10 @@ int __init sctp_snmp_proc_init(void)
108{ 108{
109 struct proc_dir_entry *p; 109 struct proc_dir_entry *p;
110 110
111 p = create_proc_entry("snmp", S_IRUGO, proc_net_sctp); 111 p = proc_create("snmp", S_IRUGO, proc_net_sctp, &sctp_snmp_seq_fops);
112 if (!p) 112 if (!p)
113 return -ENOMEM; 113 return -ENOMEM;
114 114
115 p->proc_fops = &sctp_snmp_seq_fops;
116
117 return 0; 115 return 0;
118} 116}
119 117
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 22a16571499c..688546dccd82 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -832,7 +832,7 @@ static inline int sctp_v4_xmit(struct sk_buff *skb,
832 return ip_queue_xmit(skb, ipfragok); 832 return ip_queue_xmit(skb, ipfragok);
833} 833}
834 834
835static struct sctp_af sctp_ipv4_specific; 835static struct sctp_af sctp_af_inet;
836 836
837static struct sctp_pf sctp_pf_inet = { 837static struct sctp_pf sctp_pf_inet = {
838 .event_msgname = sctp_inet_event_msgname, 838 .event_msgname = sctp_inet_event_msgname,
@@ -844,7 +844,7 @@ static struct sctp_pf sctp_pf_inet = {
844 .supported_addrs = sctp_inet_supported_addrs, 844 .supported_addrs = sctp_inet_supported_addrs,
845 .create_accept_sk = sctp_v4_create_accept_sk, 845 .create_accept_sk = sctp_v4_create_accept_sk,
846 .addr_v4map = sctp_v4_addr_v4map, 846 .addr_v4map = sctp_v4_addr_v4map,
847 .af = &sctp_ipv4_specific, 847 .af = &sctp_af_inet
848}; 848};
849 849
850/* Notifier for inetaddr addition/deletion events. */ 850/* Notifier for inetaddr addition/deletion events. */
@@ -906,7 +906,7 @@ static struct net_protocol sctp_protocol = {
906}; 906};
907 907
908/* IPv4 address related functions. */ 908/* IPv4 address related functions. */
909static struct sctp_af sctp_ipv4_specific = { 909static struct sctp_af sctp_af_inet = {
910 .sa_family = AF_INET, 910 .sa_family = AF_INET,
911 .sctp_xmit = sctp_v4_xmit, 911 .sctp_xmit = sctp_v4_xmit,
912 .setsockopt = ip_setsockopt, 912 .setsockopt = ip_setsockopt,
@@ -1192,7 +1192,7 @@ SCTP_STATIC __init int sctp_init(void)
1192 sctp_sysctl_register(); 1192 sctp_sysctl_register();
1193 1193
1194 INIT_LIST_HEAD(&sctp_address_families); 1194 INIT_LIST_HEAD(&sctp_address_families);
1195 sctp_register_af(&sctp_ipv4_specific); 1195 sctp_register_af(&sctp_af_inet);
1196 1196
1197 status = proto_register(&sctp_prot, 1); 1197 status = proto_register(&sctp_prot, 1);
1198 if (status) 1198 if (status)
@@ -1249,7 +1249,7 @@ err_v6_init:
1249 proto_unregister(&sctp_prot); 1249 proto_unregister(&sctp_prot);
1250err_proto_register: 1250err_proto_register:
1251 sctp_sysctl_unregister(); 1251 sctp_sysctl_unregister();
1252 list_del(&sctp_ipv4_specific.list); 1252 list_del(&sctp_af_inet.list);
1253 free_pages((unsigned long)sctp_port_hashtable, 1253 free_pages((unsigned long)sctp_port_hashtable,
1254 get_order(sctp_port_hashsize * 1254 get_order(sctp_port_hashsize *
1255 sizeof(struct sctp_bind_hashbucket))); 1255 sizeof(struct sctp_bind_hashbucket)));
@@ -1299,7 +1299,7 @@ SCTP_STATIC __exit void sctp_exit(void)
1299 inet_unregister_protosw(&sctp_seqpacket_protosw); 1299 inet_unregister_protosw(&sctp_seqpacket_protosw);
1300 1300
1301 sctp_sysctl_unregister(); 1301 sctp_sysctl_unregister();
1302 list_del(&sctp_ipv4_specific.list); 1302 list_del(&sctp_af_inet.list);
1303 1303
1304 free_pages((unsigned long)sctp_assoc_hashtable, 1304 free_pages((unsigned long)sctp_assoc_hashtable,
1305 get_order(sctp_assoc_hashsize * 1305 get_order(sctp_assoc_hashsize *
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index d47d5787e2e5..939892691a26 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -1964,7 +1964,7 @@ static int sctp_setsockopt_disable_fragments(struct sock *sk,
1964static int sctp_setsockopt_events(struct sock *sk, char __user *optval, 1964static int sctp_setsockopt_events(struct sock *sk, char __user *optval,
1965 int optlen) 1965 int optlen)
1966{ 1966{
1967 if (optlen != sizeof(struct sctp_event_subscribe)) 1967 if (optlen > sizeof(struct sctp_event_subscribe))
1968 return -EINVAL; 1968 return -EINVAL;
1969 if (copy_from_user(&sctp_sk(sk)->subscribe, optval, optlen)) 1969 if (copy_from_user(&sctp_sk(sk)->subscribe, optval, optlen))
1970 return -EFAULT; 1970 return -EFAULT;
@@ -5070,6 +5070,7 @@ static int sctp_getsockopt_peer_auth_chunks(struct sock *sk, int len,
5070 struct sctp_authchunks val; 5070 struct sctp_authchunks val;
5071 struct sctp_association *asoc; 5071 struct sctp_association *asoc;
5072 struct sctp_chunks_param *ch; 5072 struct sctp_chunks_param *ch;
5073 u32 num_chunks;
5073 char __user *to; 5074 char __user *to;
5074 5075
5075 if (len <= sizeof(struct sctp_authchunks)) 5076 if (len <= sizeof(struct sctp_authchunks))
@@ -5086,12 +5087,15 @@ static int sctp_getsockopt_peer_auth_chunks(struct sock *sk, int len,
5086 ch = asoc->peer.peer_chunks; 5087 ch = asoc->peer.peer_chunks;
5087 5088
5088 /* See if the user provided enough room for all the data */ 5089 /* See if the user provided enough room for all the data */
5089 if (len < ntohs(ch->param_hdr.length)) 5090 num_chunks = ntohs(ch->param_hdr.length) - sizeof(sctp_paramhdr_t);
5091 if (len < num_chunks)
5090 return -EINVAL; 5092 return -EINVAL;
5091 5093
5092 len = ntohs(ch->param_hdr.length); 5094 len = num_chunks;
5093 if (put_user(len, optlen)) 5095 if (put_user(len, optlen))
5094 return -EFAULT; 5096 return -EFAULT;
5097 if (put_user(num_chunks, &p->gauth_number_of_chunks))
5098 return -EFAULT;
5095 if (copy_to_user(to, ch->chunks, len)) 5099 if (copy_to_user(to, ch->chunks, len))
5096 return -EFAULT; 5100 return -EFAULT;
5097 5101
@@ -5105,6 +5109,7 @@ static int sctp_getsockopt_local_auth_chunks(struct sock *sk, int len,
5105 struct sctp_authchunks val; 5109 struct sctp_authchunks val;
5106 struct sctp_association *asoc; 5110 struct sctp_association *asoc;
5107 struct sctp_chunks_param *ch; 5111 struct sctp_chunks_param *ch;
5112 u32 num_chunks;
5108 char __user *to; 5113 char __user *to;
5109 5114
5110 if (len <= sizeof(struct sctp_authchunks)) 5115 if (len <= sizeof(struct sctp_authchunks))
@@ -5123,12 +5128,15 @@ static int sctp_getsockopt_local_auth_chunks(struct sock *sk, int len,
5123 else 5128 else
5124 ch = sctp_sk(sk)->ep->auth_chunk_list; 5129 ch = sctp_sk(sk)->ep->auth_chunk_list;
5125 5130
5126 if (len < ntohs(ch->param_hdr.length)) 5131 num_chunks = ntohs(ch->param_hdr.length) - sizeof(sctp_paramhdr_t);
5132 if (len < num_chunks)
5127 return -EINVAL; 5133 return -EINVAL;
5128 5134
5129 len = ntohs(ch->param_hdr.length); 5135 len = num_chunks;
5130 if (put_user(len, optlen)) 5136 if (put_user(len, optlen))
5131 return -EFAULT; 5137 return -EFAULT;
5138 if (put_user(num_chunks, &p->gauth_number_of_chunks))
5139 return -EFAULT;
5132 if (copy_to_user(to, ch->chunks, len)) 5140 if (copy_to_user(to, ch->chunks, len))
5133 return -EFAULT; 5141 return -EFAULT;
5134 5142
@@ -6488,6 +6496,7 @@ struct proto sctp_prot = {
6488 .memory_pressure = &sctp_memory_pressure, 6496 .memory_pressure = &sctp_memory_pressure,
6489 .enter_memory_pressure = sctp_enter_memory_pressure, 6497 .enter_memory_pressure = sctp_enter_memory_pressure,
6490 .memory_allocated = &sctp_memory_allocated, 6498 .memory_allocated = &sctp_memory_allocated,
6499 .sockets_allocated = &sctp_sockets_allocated,
6491 REF_PROTO_INUSE(sctp) 6500 REF_PROTO_INUSE(sctp)
6492}; 6501};
6493 6502
@@ -6521,6 +6530,7 @@ struct proto sctpv6_prot = {
6521 .memory_pressure = &sctp_memory_pressure, 6530 .memory_pressure = &sctp_memory_pressure,
6522 .enter_memory_pressure = sctp_enter_memory_pressure, 6531 .enter_memory_pressure = sctp_enter_memory_pressure,
6523 .memory_allocated = &sctp_memory_allocated, 6532 .memory_allocated = &sctp_memory_allocated,
6533 .sockets_allocated = &sctp_sockets_allocated,
6524 REF_PROTO_INUSE(sctpv6) 6534 REF_PROTO_INUSE(sctpv6)
6525}; 6535};
6526#endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ 6536#endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */
diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
index e27b11f18b7f..b43f1f110f87 100644
--- a/net/sctp/ulpevent.c
+++ b/net/sctp/ulpevent.c
@@ -206,7 +206,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_assoc_change(
206 * This field is the total length of the notification data, including 206 * This field is the total length of the notification data, including
207 * the notification header. 207 * the notification header.
208 */ 208 */
209 sac->sac_length = sizeof(struct sctp_assoc_change); 209 sac->sac_length = skb->len;
210 210
211 /* Socket Extensions for SCTP 211 /* Socket Extensions for SCTP
212 * 5.3.1.1 SCTP_ASSOC_CHANGE 212 * 5.3.1.1 SCTP_ASSOC_CHANGE