git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
net
/
sctp
/
endpointola.c
diff --git
a/net/sctp/endpointola.c
b/net/sctp/endpointola.c
index
67bd530
..
1297569
100644
(file)
--- a/
net/sctp/endpointola.c
+++ b/
net/sctp/endpointola.c
@@
-61,7
+61,7
@@
#include <net/sctp/sm.h>
/* Forward declarations for internal helpers. */
#include <net/sctp/sm.h>
/* Forward declarations for internal helpers. */
-static void sctp_endpoint_bh_rcv(struct
sctp_endpoint *ep
);
+static void sctp_endpoint_bh_rcv(struct
work_struct *work
);
/*
* Initialize the base fields of the endpoint structure.
/*
* Initialize the base fields of the endpoint structure.
@@
-72,6
+72,10
@@
static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
{
memset(ep, 0, sizeof(struct sctp_endpoint));
{
memset(ep, 0, sizeof(struct sctp_endpoint));
+ ep->digest = kzalloc(SCTP_SIGNATURE_SIZE, gfp);
+ if (!ep->digest)
+ return NULL;
+
/* Initialize the base structure. */
/* What type of endpoint are we? */
ep->base.type = SCTP_EP_TYPE_SOCKET;
/* Initialize the base structure. */
/* What type of endpoint are we? */
ep->base.type = SCTP_EP_TYPE_SOCKET;
@@
-85,8
+89,7
@@
static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
sctp_inq_init(&ep->base.inqueue);
/* Set its top-half handler */
sctp_inq_init(&ep->base.inqueue);
/* Set its top-half handler */
- sctp_inq_set_th_handler(&ep->base.inqueue,
- (void (*)(void *))sctp_endpoint_bh_rcv, ep);
+ sctp_inq_set_th_handler(&ep->base.inqueue, sctp_endpoint_bh_rcv);
/* Initialize the bind addr area */
sctp_bind_addr_init(&ep->base.bind_addr, 0);
/* Initialize the bind addr area */
sctp_bind_addr_init(&ep->base.bind_addr, 0);
@@
-144,6
+147,13
@@
void sctp_endpoint_add_asoc(struct sctp_endpoint *ep,
{
struct sock *sk = ep->base.sk;
{
struct sock *sk = ep->base.sk;
+ /* If this is a temporary association, don't bother
+ * since we'll be removing it shortly and don't
+ * want anyone to find it anyway.
+ */
+ if (asoc->temp)
+ return;
+
/* Now just add it to our list of asocs */
list_add_tail(&asoc->asocs, &ep->asocs);
/* Now just add it to our list of asocs */
list_add_tail(&asoc->asocs, &ep->asocs);
@@
-158,6
+168,12
@@
void sctp_endpoint_add_asoc(struct sctp_endpoint *ep,
void sctp_endpoint_free(struct sctp_endpoint *ep)
{
ep->base.dead = 1;
void sctp_endpoint_free(struct sctp_endpoint *ep)
{
ep->base.dead = 1;
+
+ ep->base.sk->sk_state = SCTP_SS_CLOSED;
+
+ /* Unlink this endpoint, so we can't find it again! */
+ sctp_unhash_endpoint(ep);
+
sctp_endpoint_put(ep);
}
sctp_endpoint_put(ep);
}
@@
-166,13
+182,11
@@
static void sctp_endpoint_destroy(struct sctp_endpoint *ep)
{
SCTP_ASSERT(ep->base.dead, "Endpoint is not dead", return);
{
SCTP_ASSERT(ep->base.dead, "Endpoint is not dead", return);
- ep->base.sk->sk_state = SCTP_SS_CLOSED;
-
- /* Unlink this endpoint, so we can't find it again! */
- sctp_unhash_endpoint(ep);
-
/* Free up the HMAC transform. */
/* Free up the HMAC transform. */
- sctp_crypto_free_tfm(sctp_sk(ep->base.sk)->hmac);
+ crypto_free_hash(sctp_sk(ep->base.sk)->hmac);
+
+ /* Free the digest buffer */
+ kfree(ep->digest);
/* Cleanup. */
sctp_inq_free(&ep->base.inqueue);
/* Cleanup. */
sctp_inq_free(&ep->base.inqueue);
@@
-215,7
+229,7
@@
struct sctp_endpoint *sctp_endpoint_is_match(struct sctp_endpoint *ep,
struct sctp_endpoint *retval;
sctp_read_lock(&ep->base.addr_lock);
struct sctp_endpoint *retval;
sctp_read_lock(&ep->base.addr_lock);
- if (
ep->base.bind_addr.port
== laddr->v4.sin_port) {
+ if (
htons(ep->base.bind_addr.port)
== laddr->v4.sin_port) {
if (sctp_bind_addr_match(&ep->base.bind_addr, laddr,
sctp_sk(ep->base.sk))) {
retval = ep;
if (sctp_bind_addr_match(&ep->base.bind_addr, laddr,
sctp_sk(ep->base.sk))) {
retval = ep;
@@
-243,7
+257,7
@@
static struct sctp_association *__sctp_endpoint_lookup_assoc(
struct sctp_association *asoc;
struct list_head *pos;
struct sctp_association *asoc;
struct list_head *pos;
- rport =
paddr->v4.sin_port
;
+ rport =
ntohs(paddr->v4.sin_port)
;
list_for_each(pos, &ep->asocs) {
asoc = list_entry(pos, struct sctp_association, asocs);
list_for_each(pos, &ep->asocs) {
asoc = list_entry(pos, struct sctp_association, asocs);
@@
-303,8
+317,11
@@
int sctp_endpoint_is_peeled_off(struct sctp_endpoint *ep,
/* Do delayed input processing. This is scheduled by sctp_rcv().
* This may be called on BH or task time.
*/
/* Do delayed input processing. This is scheduled by sctp_rcv().
* This may be called on BH or task time.
*/
-static void sctp_endpoint_bh_rcv(struct
sctp_endpoint *ep
)
+static void sctp_endpoint_bh_rcv(struct
work_struct *work
)
{
{
+ struct sctp_endpoint *ep =
+ container_of(work, struct sctp_endpoint,
+ base.inqueue.immediate);
struct sctp_association *asoc;
struct sock *sk;
struct sctp_transport *transport;
struct sctp_association *asoc;
struct sock *sk;
struct sctp_transport *transport;