From 79a238547552b91ceb5a25062d14c24f73e2f4b0 Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Wed, 4 Mar 2009 03:20:26 -0800 Subject: [PATCH] --- yaml --- r: 132143 b: refs/heads/master c: fb13d9f9e450bceafd88ac8a98f7a98e8096a5fe h: refs/heads/master i: 132141: 6d4893e19f18a1e5a18be0ef180767a7be2ea71e 132139: c97302eac86a5ebf9cb045578ddea4e0eb1bbbbc 132135: a3fddabab80820192e60c1bcd6cbc3bb1b5b48d3 132127: c8764d4f0fb917e1ccc4fbf06ebde3479c687c92 v: v3 --- [refs] | 2 +- trunk/net/sctp/protocol.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 7258a43d1258..3937eb2b5ec4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fe7ca2e1e847b65c12d245cbf402af89da96888a +refs/heads/master: fb13d9f9e450bceafd88ac8a98f7a98e8096a5fe diff --git a/trunk/net/sctp/protocol.c b/trunk/net/sctp/protocol.c index 4e6638449639..c4986d0f7419 100644 --- a/trunk/net/sctp/protocol.c +++ b/trunk/net/sctp/protocol.c @@ -717,15 +717,20 @@ static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev, static int sctp_ctl_sock_init(void) { int err; - sa_family_t family; + sa_family_t family = PF_INET; if (sctp_get_pf_specific(PF_INET6)) family = PF_INET6; - else - family = PF_INET; err = inet_ctl_sock_create(&sctp_ctl_sock, family, 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) { printk(KERN_ERR "SCTP: Failed to create the SCTP control socket.\n");