diff options
Diffstat (limited to 'net/sctp/protocol.c')
-rw-r--r-- | net/sctp/protocol.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index b78e3be69013..c4986d0f7419 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -717,15 +717,20 @@ static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev, | |||
717 | static int sctp_ctl_sock_init(void) | 717 | static int sctp_ctl_sock_init(void) |
718 | { | 718 | { |
719 | int err; | 719 | int err; |
720 | sa_family_t family; | 720 | sa_family_t family = PF_INET; |
721 | 721 | ||
722 | if (sctp_get_pf_specific(PF_INET6)) | 722 | if (sctp_get_pf_specific(PF_INET6)) |
723 | family = PF_INET6; | 723 | family = PF_INET6; |
724 | else | ||
725 | family = PF_INET; | ||
726 | 724 | ||
727 | err = inet_ctl_sock_create(&sctp_ctl_sock, family, | 725 | err = inet_ctl_sock_create(&sctp_ctl_sock, family, |
728 | SOCK_SEQPACKET, IPPROTO_SCTP, &init_net); | 726 | SOCK_SEQPACKET, IPPROTO_SCTP, &init_net); |
727 | |||
728 | /* If IPv6 socket could not be created, try the IPv4 socket */ | ||
729 | if (err < 0 && family == PF_INET6) | ||
730 | err = inet_ctl_sock_create(&sctp_ctl_sock, AF_INET, | ||
731 | SOCK_SEQPACKET, IPPROTO_SCTP, | ||
732 | &init_net); | ||
733 | |||
729 | if (err < 0) { | 734 | if (err < 0) { |
730 | printk(KERN_ERR | 735 | printk(KERN_ERR |
731 | "SCTP: Failed to create the SCTP control socket.\n"); | 736 | "SCTP: Failed to create the SCTP control socket.\n"); |
@@ -1322,9 +1327,8 @@ SCTP_STATIC __init int sctp_init(void) | |||
1322 | out: | 1327 | out: |
1323 | return status; | 1328 | return status; |
1324 | err_v6_add_protocol: | 1329 | err_v6_add_protocol: |
1325 | sctp_v6_del_protocol(); | ||
1326 | err_add_protocol: | ||
1327 | sctp_v4_del_protocol(); | 1330 | sctp_v4_del_protocol(); |
1331 | err_add_protocol: | ||
1328 | inet_ctl_sock_destroy(sctp_ctl_sock); | 1332 | inet_ctl_sock_destroy(sctp_ctl_sock); |
1329 | err_ctl_sock_init: | 1333 | err_ctl_sock_init: |
1330 | sctp_v6_protosw_exit(); | 1334 | sctp_v6_protosw_exit(); |
@@ -1335,7 +1339,6 @@ err_protosw_init: | |||
1335 | sctp_v4_pf_exit(); | 1339 | sctp_v4_pf_exit(); |
1336 | sctp_v6_pf_exit(); | 1340 | sctp_v6_pf_exit(); |
1337 | sctp_sysctl_unregister(); | 1341 | sctp_sysctl_unregister(); |
1338 | list_del(&sctp_af_inet.list); | ||
1339 | free_pages((unsigned long)sctp_port_hashtable, | 1342 | free_pages((unsigned long)sctp_port_hashtable, |
1340 | get_order(sctp_port_hashsize * | 1343 | get_order(sctp_port_hashsize * |
1341 | sizeof(struct sctp_bind_hashbucket))); | 1344 | sizeof(struct sctp_bind_hashbucket))); |
@@ -1383,7 +1386,6 @@ SCTP_STATIC __exit void sctp_exit(void) | |||
1383 | sctp_v4_pf_exit(); | 1386 | sctp_v4_pf_exit(); |
1384 | 1387 | ||
1385 | sctp_sysctl_unregister(); | 1388 | sctp_sysctl_unregister(); |
1386 | list_del(&sctp_af_inet.list); | ||
1387 | 1389 | ||
1388 | free_pages((unsigned long)sctp_assoc_hashtable, | 1390 | free_pages((unsigned long)sctp_assoc_hashtable, |
1389 | get_order(sctp_assoc_hashsize * | 1391 | get_order(sctp_assoc_hashsize * |