|
@@ -717,15 +717,20 @@ static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev,
|
|
static int sctp_ctl_sock_init(void)
|
|
static int sctp_ctl_sock_init(void)
|
|
{
|
|
{
|
|
int err;
|
|
int err;
|
|
- sa_family_t family;
|
|
|
|
|
|
+ sa_family_t family = PF_INET;
|
|
|
|
|
|
if (sctp_get_pf_specific(PF_INET6))
|
|
if (sctp_get_pf_specific(PF_INET6))
|
|
family = PF_INET6;
|
|
family = PF_INET6;
|
|
- else
|
|
|
|
- family = PF_INET;
|
|
|
|
|
|
|
|
err = inet_ctl_sock_create(&sctp_ctl_sock, family,
|
|
err = inet_ctl_sock_create(&sctp_ctl_sock, family,
|
|
SOCK_SEQPACKET, IPPROTO_SCTP, &init_net);
|
|
SOCK_SEQPACKET, IPPROTO_SCTP, &init_net);
|
|
|
|
+
|
|
|
|
+ /* If IPv6 socket could not be created, try the IPv4 socket */
|
|
|
|
+ if (err < 0 && family == PF_INET6)
|
|
|
|
+ err = inet_ctl_sock_create(&sctp_ctl_sock, AF_INET,
|
|
|
|
+ SOCK_SEQPACKET, IPPROTO_SCTP,
|
|
|
|
+ &init_net);
|
|
|
|
+
|
|
if (err < 0) {
|
|
if (err < 0) {
|
|
printk(KERN_ERR
|
|
printk(KERN_ERR
|
|
"SCTP: Failed to create the SCTP control socket.\n");
|
|
"SCTP: Failed to create the SCTP control socket.\n");
|