From nobody@FreeBSD.org  Thu Feb 16 19:18:31 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CB3F1106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Feb 2012 19:18:31 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id BA8F68FC19
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Feb 2012 19:18:31 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q1GJIUEt076735
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Feb 2012 19:18:30 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q1GJIUGi076734;
	Thu, 16 Feb 2012 19:18:30 GMT
	(envelope-from nobody)
Message-Id: <201202161918.q1GJIUGi076734@red.freebsd.org>
Date: Thu, 16 Feb 2012 19:18:30 GMT
From: Maxim "WGH" <wgh@torlan.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: SCTP sockets don't bind on interfaces created by netgraph
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         165210
>Category:       kern
>Synopsis:       [sctp] SCTP sockets don't bind on interfaces created by netgraph
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    rrs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 16 19:20:07 UTC 2012
>Closed-Date:    Mon Mar 12 15:21:25 UTC 2012
>Last-Modified:  Mon Mar 12 15:21:25 UTC 2012
>Originator:     Maxim "WGH"
>Release:        8.1-RELEASE-p1
>Organization:
>Environment:
FreeBSD torlan 8.1-RELEASE-p1 FreeBSD 8.1-RELEASE-p1 #8: Sat Oct 30 23:25:06 MSD 2010     wgh@torlan:/usr/obj/usr/src/sys/TORLAN  i386
>Description:
I was experimenting with SCTP, and I noticed I couldn't bind SCTP socket to interface ng0, which was created by mpd5 (net/mpd5) daemon.
bind() system calls fails with errno 49 "Can't assign requested address". It does bind on any other address in the system, including 0.0.0.0 (INADDR_ANY). The latter still doesn't allow incoming SCTP connections on that address though (although instead of "connection refused" I get hanging connect()).

I've looked through both netgraph and sctp source code. netgraph creates IFT_PROPVIRTUAL interfaces, and there is a function in sctp called sctp_is_desired_interface_type. The latter doesn't think that IFT_PROPVIRTUAL is something desirable.

I believe it's a bug, because netgraph is a generic framework, and there is no reason to not allow creation of SCTP sockets on its interfaces. For instance, I use L2TP provided by mpd5 as main internet connection.
>How-To-Repeat:

>Fix:
Added the interface type to the allowed list.


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->rrs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Feb 17 20:23:18 UTC 2012 
Responsible-Changed-Why:  
Randall, are you still working on sctp?  If not, just reassign the PR 
back to freebsd-net@. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=165210 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/165210: commit references a PR
Date: Mon, 12 Mar 2012 15:05:31 +0000 (UTC)

 Author: rrs
 Date: Mon Mar 12 15:05:17 2012
 New Revision: 232866
 URL: http://svn.freebsd.org/changeset/base/232866
 Log:
   This fixes PR 165210. Basically we just
   add in the netgraph interface to the list of
   acceptable interfaces. A todo at the next
   IETF code blitz, though is we need to review
   why we screen interfaces, there was a reason ;-).
   
   PR:		165210
   MFC after:	1 week
 
 Modified:
   head/sys/netinet/sctp_bsd_addr.c
 
 Modified: head/sys/netinet/sctp_bsd_addr.c
 ==============================================================================
 --- head/sys/netinet/sctp_bsd_addr.c	Mon Mar 12 14:07:57 2012	(r232865)
 +++ head/sys/netinet/sctp_bsd_addr.c	Mon Mar 12 15:05:17 2012	(r232866)
 @@ -184,6 +184,7 @@ sctp_is_desired_interface_type(struct if
  	case IFT_IP:
  	case IFT_IPOVERCDLC:
  	case IFT_IPOVERCLAW:
 +	case IFT_PROPVIRTUAL:	/* NetGraph Virtual too */
  	case IFT_VIRTUALIPADDRESS:
  		result = 1;
  		break;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed  
State-Changed-By: rrs 
State-Changed-When: Mon Mar 12 15:20:20 UTC 2012 
State-Changed-Why:  
This closes the PR I hope... need to find the wiki on 
how to use this tool (gnats ;-0) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=165210 
>Unformatted:
