Abort on unexpected SCTP errors
authorMichael Spang <mspang@uwaterloo.ca>
Wed, 29 Jul 2009 12:18:35 +0000 (08:18 -0400)
committerMichael Spang <mspang@uwaterloo.ca>
Wed, 29 Jul 2009 12:18:35 +0000 (08:18 -0400)
src/net.c

index 5bf3be7..dc85682 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -71,6 +71,19 @@ static size_t recv_one_message(int sock, struct sctp_meta *msg_meta, struct strb
             case SCTP_SHUTDOWN_EVENT:
                 fatal("connection shut down");
                 break;
+            case SCTP_ASSOC_CHANGE:
+                switch (sn->sn_assoc_change.sac_state) {
+                    case SCTP_COMM_LOST:
+                        fatal("connection lost");
+                        break;
+                    case SCTP_SHUTDOWN_COMP:
+                        fatal("shutdown complete");
+                        break;
+                    case SCTP_CANT_STR_ASSOC:
+                        fatal("cannot start association");
+                        break;
+                }
+                break;
         }
     }