Bug 674175

Summary: Impossible to load sctp module with ipv6 disable=1
Product: Red Hat Enterprise Linux 5 Reporter: Flavio Leitner <fleitner>
Component: kernelAssignee: Jiri Pirko <jpirko>
Status: CLOSED ERRATA QA Contact: Boris Ranto <branto>
Severity: high Docs Contact:
Priority: high    
Version: 5.5CC: anton, branto, jolsa, jpirko, jwest, mjenner, nhorman, qcai, rkhan, tgraf
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-21 10:10:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Flavio Leitner 2011-01-31 21:01:09 UTC
Description of problem:

The sctp module tries to create an IPv6 socket when loading at sctp_ctl_sock_init() and if ipv6 module is disabled, the call returns an error failing to load the sctp module.

Version-Release number of selected component (if applicable):
2.6.18-238.el5

How reproducible:
Always

Steps to Reproduce:
1. load ipv6 module passing disable=1
2. try to load sctp module
  
The following upstream patch fixes the issue:

commit fb13d9f9e450bceafd88ac8a98f7a98e8096a5fe
Author: Brian Haley <brian.haley>
Date:   Wed Mar 4 03:20:26 2009 -0800

    SCTP: change sctp_ctl_sock_init() to try IPv4 if IPv6 fails
    
    Change sctp_ctl_sock_init() to try IPv4 if IPv6 socket registration
    fails.  Required if the IPv6 module is loaded with "disable=1", else
    SCTP will fail to load.
    
    Signed-off-by: Brian Haley <brian.haley>
    Signed-off-by: Vlad Yasevich <vladislav.yasevich>
    Signed-off-by: David S. Miller <davem>

diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 4e66384..c4986d0 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -661,15 +661,19 @@ 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 = sock_create_kern(family, SOCK_SEQPACKET, IPPROTO_SCTP,
 			       &sctp_ctl_socket);
+
+	/* If IPv6 socket could not be created, try the IPv4 socket */
+	if (err < 0 && family == PF_INET6)
+		err = sock_create_kern(AF_INET, SOCK_SEQPACKET,
+				       IPPROTO_SCTP, &sctp_ctl_socket);
+
 	if (err < 0) {
 		printk(KERN_ERR
 		       "SCTP: Failed to create the SCTP control socket.\n");

Comment 3 Neil Horman 2011-02-04 17:16:28 UTC
sure, thanks

Comment 7 RHEL Program Management 2011-02-25 18:20:11 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 9 Jarod Wilson 2011-03-03 20:34:32 UTC
in kernel-2.6.18-246.el5
You can download this test kernel (or newer) from http://people.redhat.com/jwilson/el5

Detailed testing feedback is always welcomed.

Comment 14 errata-xmlrpc 2011-07-21 10:10:18 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-1065.html