Author: tuexen
Date: Tue Jul 12 19:29:29 2011
New Revision: 223963
URL: http://svn.freebsd.org/changeset/base/223963

Log:
  The socket API only specifies SCTP for SOCK_SEQPACKET and
  SOCK_STREAM, but not SOCK_DGRAM. So don't register it for
  SOCK_DGRAM.
  While there, fix some indentation.

Modified:
  head/sys/netinet/in_proto.c
  head/sys/netinet6/in6_proto.c

Modified: head/sys/netinet/in_proto.c
==============================================================================
--- head/sys/netinet/in_proto.c Tue Jul 12 18:10:56 2011        (r223962)
+++ head/sys/netinet/in_proto.c Tue Jul 12 19:29:29 2011        (r223963)
@@ -163,7 +163,7 @@ struct protosw inetsw[] = {
 },
 #ifdef SCTP
 { 
-       .pr_type =              SOCK_DGRAM,
+       .pr_type =              SOCK_SEQPACKET,
        .pr_domain =            &inetdomain,
        .pr_protocol =          IPPROTO_SCTP,
        .pr_flags =             PR_WANTRCVD,
@@ -177,18 +177,6 @@ struct protosw inetsw[] = {
        .pr_drain =             sctp_drain,
        .pr_usrreqs =           &sctp_usrreqs
 },
-{
-       .pr_type =              SOCK_SEQPACKET,
-       .pr_domain =            &inetdomain,
-       .pr_protocol =          IPPROTO_SCTP,
-       .pr_flags =             PR_WANTRCVD,
-       .pr_input =             sctp_input,
-       .pr_ctlinput =          sctp_ctlinput,
-       .pr_ctloutput =         sctp_ctloutput,
-       .pr_drain =             sctp_drain,
-       .pr_usrreqs =           &sctp_usrreqs
-},
-
 { 
        .pr_type =              SOCK_STREAM,
        .pr_domain =            &inetdomain,

Modified: head/sys/netinet6/in6_proto.c
==============================================================================
--- head/sys/netinet6/in6_proto.c       Tue Jul 12 18:10:56 2011        
(r223962)
+++ head/sys/netinet6/in6_proto.c       Tue Jul 12 19:29:29 2011        
(r223963)
@@ -192,41 +192,29 @@ struct ip6protosw inet6sw[] = {
 },
 #ifdef SCTP
 {
-       .pr_type =      SOCK_DGRAM,
-       .pr_domain =    &inet6domain,
-        .pr_protocol = IPPROTO_SCTP,
-        .pr_flags =    PR_WANTRCVD,
-        .pr_input =    sctp6_input,
-        .pr_ctlinput =  sctp6_ctlinput,
-        .pr_ctloutput = sctp_ctloutput,
-        .pr_drain =    sctp_drain,
+       .pr_type =              SOCK_SEQPACKET,
+       .pr_domain =            &inet6domain,
+       .pr_protocol =          IPPROTO_SCTP,
+       .pr_flags =             PR_WANTRCVD,
+       .pr_input =             sctp6_input,
+       .pr_ctlinput =          sctp6_ctlinput,
+       .pr_ctloutput = sctp_ctloutput,
+       .pr_drain =             sctp_drain,
 #ifndef INET   /* Do not call initialization twice. */
-       .pr_init =      sctp_init,
+       .pr_init =              sctp_init,
 #endif
-        .pr_usrreqs =  &sctp6_usrreqs
+       .pr_usrreqs =           &sctp6_usrreqs
 },
 {
-       .pr_type =      SOCK_SEQPACKET,
-       .pr_domain =    &inet6domain,
-        .pr_protocol = IPPROTO_SCTP,
-        .pr_flags =    PR_WANTRCVD,
-        .pr_input =    sctp6_input,
-        .pr_ctlinput =  sctp6_ctlinput,
-        .pr_ctloutput = sctp_ctloutput,
-        .pr_drain =    sctp_drain,
-        .pr_usrreqs =  &sctp6_usrreqs
-},
-
-{
-       .pr_type =      SOCK_STREAM,
-       .pr_domain =    &inet6domain,
-        .pr_protocol = IPPROTO_SCTP,
-        .pr_flags =    PR_WANTRCVD,
-        .pr_input =    sctp6_input,
-        .pr_ctlinput =  sctp6_ctlinput,
-        .pr_ctloutput = sctp_ctloutput,
-        .pr_drain =    sctp_drain,
-        .pr_usrreqs =  &sctp6_usrreqs
+       .pr_type =              SOCK_STREAM,
+       .pr_domain =            &inet6domain,
+       .pr_protocol =          IPPROTO_SCTP,
+       .pr_flags =             PR_WANTRCVD,
+       .pr_input =             sctp6_input,
+       .pr_ctlinput =  sctp6_ctlinput,
+       .pr_ctloutput =         sctp_ctloutput,
+       .pr_drain =             sctp_drain,
+       .pr_usrreqs =           &sctp6_usrreqs
 },
 #endif /* SCTP */
 {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to