aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/protocol.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-03-05 05:06:47 -0500
committerDavid S. Miller <davem@davemloft.net>2009-03-05 05:06:47 -0500
commit508827ff0ac3981d420edac64a70de7f4e304d38 (patch)
treeb0cee8ddef9f0ceab68c388e4ae46b7295eb2cb5 /net/sctp/protocol.c
parent2c3c3d02f28801d7ad2da4952b2c7ca6621ef221 (diff)
parent72e2240f181871675d3a979766330c91d48a1673 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/tokenring/tmspci.c drivers/net/ucc_geth_mii.c
Diffstat (limited to 'net/sctp/protocol.c')
-rw-r--r--net/sctp/protocol.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index c1e316ee7155..cb198af8887c 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -692,15 +692,20 @@ static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev,
692static int sctp_ctl_sock_init(void) 692static int sctp_ctl_sock_init(void)
693{ 693{
694 int err; 694 int err;
695 sa_family_t family; 695 sa_family_t family = PF_INET;
696 696
697 if (sctp_get_pf_specific(PF_INET6)) 697 if (sctp_get_pf_specific(PF_INET6))
698 family = PF_INET6; 698 family = PF_INET6;
699 else
700 family = PF_INET;
701 699
702 err = inet_ctl_sock_create(&sctp_ctl_sock, family, 700 err = inet_ctl_sock_create(&sctp_ctl_sock, family,
703 SOCK_SEQPACKET, IPPROTO_SCTP, &init_net); 701 SOCK_SEQPACKET, IPPROTO_SCTP, &init_net);
702
703 /* If IPv6 socket could not be created, try the IPv4 socket */
704 if (err < 0 && family == PF_INET6)
705 err = inet_ctl_sock_create(&sctp_ctl_sock, AF_INET,
706 SOCK_SEQPACKET, IPPROTO_SCTP,
707 &init_net);
708
704 if (err < 0) { 709 if (err < 0) {
705 printk(KERN_ERR 710 printk(KERN_ERR
706 "SCTP: Failed to create the SCTP control socket.\n"); 711 "SCTP: Failed to create the SCTP control socket.\n");
@@ -1297,9 +1302,8 @@ SCTP_STATIC __init int sctp_init(void)
1297out: 1302out:
1298 return status; 1303 return status;
1299err_v6_add_protocol: 1304err_v6_add_protocol:
1300 sctp_v6_del_protocol();
1301err_add_protocol:
1302 sctp_v4_del_protocol(); 1305 sctp_v4_del_protocol();
1306err_add_protocol:
1303 inet_ctl_sock_destroy(sctp_ctl_sock); 1307 inet_ctl_sock_destroy(sctp_ctl_sock);
1304err_ctl_sock_init: 1308err_ctl_sock_init:
1305 sctp_v6_protosw_exit(); 1309 sctp_v6_protosw_exit();
@@ -1310,7 +1314,6 @@ err_protosw_init:
1310 sctp_v4_pf_exit(); 1314 sctp_v4_pf_exit();
1311 sctp_v6_pf_exit(); 1315 sctp_v6_pf_exit();
1312 sctp_sysctl_unregister(); 1316 sctp_sysctl_unregister();
1313 list_del(&sctp_af_inet.list);
1314 free_pages((unsigned long)sctp_port_hashtable, 1317 free_pages((unsigned long)sctp_port_hashtable,
1315 get_order(sctp_port_hashsize * 1318 get_order(sctp_port_hashsize *
1316 sizeof(struct sctp_bind_hashbucket))); 1319 sizeof(struct sctp_bind_hashbucket)));
@@ -1358,7 +1361,6 @@ SCTP_STATIC __exit void sctp_exit(void)
1358 sctp_v4_pf_exit(); 1361 sctp_v4_pf_exit();
1359 1362
1360 sctp_sysctl_unregister(); 1363 sctp_sysctl_unregister();
1361 list_del(&sctp_af_inet.list);
1362 1364
1363 free_pages((unsigned long)sctp_assoc_hashtable, 1365 free_pages((unsigned long)sctp_assoc_hashtable,
1364 get_order(sctp_assoc_hashsize * 1366 get_order(sctp_assoc_hashsize *