upgrade to linux 2.6.10-1.12_FC2
[linux-2.6.git] / net / sctp / ulpevent.c
index e804d6e..b4f2e95 100644 (file)
@@ -562,7 +562,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event(
        struct sctp_shutdown_event *sse;
        struct sk_buff *skb;
 
-       event = sctp_ulpevent_new(sizeof(struct sctp_assoc_change),
+       event = sctp_ulpevent_new(sizeof(struct sctp_shutdown_event),
                                  MSG_NOTIFICATION, gfp);
        if (!event)
                goto fail;
@@ -613,6 +613,40 @@ fail:
        return NULL;
 }
 
+/* Create and initialize a SCTP_ADAPTION_INDICATION notification.
+ *
+ * Socket Extensions for SCTP
+ * 5.3.1.6 SCTP_ADAPTION_INDICATION
+ */
+struct sctp_ulpevent *sctp_ulpevent_make_adaption_indication(
+       const struct sctp_association *asoc, int gfp)
+{
+       struct sctp_ulpevent *event;
+       struct sctp_adaption_event *sai;
+       struct sk_buff *skb;
+
+       event = sctp_ulpevent_new(sizeof(struct sctp_adaption_event),
+                                 MSG_NOTIFICATION, gfp);
+       if (!event)
+               goto fail;
+
+       skb = sctp_event2skb(event);
+       sai = (struct sctp_adaption_event *)
+               skb_put(skb, sizeof(struct sctp_adaption_event));
+
+       sai->sai_type = SCTP_ADAPTION_INDICATION;
+       sai->sai_flags = 0;
+       sai->sai_length = sizeof(struct sctp_adaption_event);
+       sai->sai_adaption_ind = asoc->peer.adaption_ind;
+       sctp_ulpevent_set_owner(event, asoc);
+       sai->sai_assoc_id = sctp_assoc2id(asoc);
+
+       return event;
+
+fail:
+       return NULL;
+}
+
 /* A message has been received.  Package this message as a notification
  * to pass it to the upper layers.  Go ahead and calculate the sndrcvinfo
  * even if filtered out later.
@@ -678,8 +712,8 @@ fail:
  *
  * 5.3.1.7 SCTP_PARTIAL_DELIVERY_EVENT
  *
- *   When a reciever is engaged in a partial delivery of a
- *   message this notification will be used to inidicate
+ *   When a receiver is engaged in a partial delivery of a
+ *   message this notification will be used to indicate
  *   various events.
  */
 struct sctp_ulpevent *sctp_ulpevent_make_pdapi(
@@ -689,7 +723,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_pdapi(
        struct sctp_pdapi_event *pd;
        struct sk_buff *skb;
 
-       event = sctp_ulpevent_new(sizeof(struct sctp_assoc_change),
+       event = sctp_ulpevent_new(sizeof(struct sctp_pdapi_event),
                                  MSG_NOTIFICATION, gfp);
        if (!event)
                goto fail;