From nobody@FreeBSD.org  Fri Dec 24 00:03:38 2010
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 BB7ED1065679
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 24 Dec 2010 00:03:38 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (unknown [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id AAF2B8FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 24 Dec 2010 00:03:38 +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 oBO03caR018072
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 24 Dec 2010 00:03:38 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id oBO03cNP018071;
	Fri, 24 Dec 2010 00:03:38 GMT
	(envelope-from nobody)
Message-Id: <201012240003.oBO03cNP018071@red.freebsd.org>
Date: Fri, 24 Dec 2010 00:03:38 GMT
From: Sebastian Zander <szander@swin.edu.au>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Port numbers always zero in dynamic IPFW rules for SCTP over IPv4
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         153415
>Category:       kern
>Synopsis:       [ipfw] [patch] Port numbers always zero in dynamic IPFW rules for SCTP over IPv4
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ipfw
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 24 00:10:10 UTC 2010
>Closed-Date:    Thu Apr 07 11:23:02 UTC 2011
>Last-Modified:  Thu Apr 07 11:23:02 UTC 2011
>Originator:     Sebastian Zander
>Release:        FreeBSD-CURRENT (revision 216463)
>Organization:
Swinburne University
>Environment:
FreeBSD szander.caia.swin.edu.au 9.0-CURRENT FreeBSD 9.0-CURRENT #5: Thu Dec 16 16:47:32 EST 2010     szander@szander.caia.swin.edu.au:/usr/obj/usr/home/szander/dev/diffuse_head/sys/GENERIC+DIFFUSE  i386
>Description:
Source and destination port numbers for dynamic rules created by IPFW are always zero for SCTP over IPv4, e.g. 
# ipfw -d show
00050  250  25080 count sctp from any to any keep-state
65000 1218 128492 allow ip from any to any
65535    0      0 deny ip from any to any
## Dynamic rules (1):
00050    5    184 (4s) STATE sctp 127.0.0.1 0 <-> 127.0.0.1 0
>How-To-Repeat:
Run IPFW with a keep-state rule that matches SCTP traffic, e.g.
ipfw add count sctp from any to any keep-state
Create SCTP traffic and run ipfw -d show.
>Fix:
--- a/sys/netinet/ipfw/ip_fw2.c Wed Dec 22 18:59:59 2010 +1100
+++ b/sys/netinet/ipfw/ip_fw2.c Fri Dec 24 10:58:03 2010 +1100
@@ -1139,6 +1139,12 @@
                                src_port = UDP(ulp)->uh_sport;
                                break;
 
+                       case IPPROTO_SCTP:
+                                PULLUP_TO(hlen, ulp, struct sctphdr);
+                                src_port = SCTP(ulp)->src_port;
+                                dst_port = SCTP(ulp)->dest_port;
+                                break;
+
                        case IPPROTO_ICMP:
                                PULLUP_TO(hlen, ulp, struct icmphdr);
                                //args->f_id.flags = ICMP(ulp)->icmp_type;


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-ipfw 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Dec 24 02:41:08 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s). 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/153415: commit references a PR
Date: Thu, 31 Mar 2011 16:30:24 +0000 (UTC)

 Author: ae
 Date: Thu Mar 31 16:30:14 2011
 New Revision: 220211
 URL: http://svn.freebsd.org/changeset/base/220211
 
 Log:
   Fill up src_port and dst_port variables for SCTP over IPv4.
   
   PR:		kern/153415
   MFC after:	1 week
 
 Modified:
   head/sys/netinet/ipfw/ip_fw2.c
 
 Modified: head/sys/netinet/ipfw/ip_fw2.c
 ==============================================================================
 --- head/sys/netinet/ipfw/ip_fw2.c	Thu Mar 31 16:19:53 2011	(r220210)
 +++ head/sys/netinet/ipfw/ip_fw2.c	Thu Mar 31 16:30:14 2011	(r220211)
 @@ -1123,6 +1123,12 @@ do {								\
  				args->f_id._flags = TCP(ulp)->th_flags;
  				break;
  
 +			case IPPROTO_SCTP:
 +				PULLUP_TO(hlen, ulp, struct sctphdr);
 +				src_port = SCTP(ulp)->src_port;
 +				dst_port = SCTP(ulp)->dest_port;
 +				break;
 +
  			case IPPROTO_UDP:
  				PULLUP_TO(hlen, ulp, struct udphdr);
  				dst_port = UDP(ulp)->uh_dport;
 _______________________________________________
 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"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/153415: commit references a PR
Date: Thu,  7 Apr 2011 11:14:05 +0000 (UTC)

 Author: ae
 Date: Thu Apr  7 11:13:50 2011
 New Revision: 220415
 URL: http://svn.freebsd.org/changeset/base/220415
 
 Log:
   MFC r220211:
     Fill up src_port and dst_port variables for SCTP over IPv4.
   
     PR:		kern/153415
 
 Modified:
   stable/8/sys/netinet/ipfw/ip_fw2.c
 Directory Properties:
   stable/8/sys/   (props changed)
   stable/8/sys/amd64/include/xen/   (props changed)
   stable/8/sys/cddl/contrib/opensolaris/   (props changed)
   stable/8/sys/contrib/dev/acpica/   (props changed)
   stable/8/sys/contrib/pf/   (props changed)
 
 Modified: stable/8/sys/netinet/ipfw/ip_fw2.c
 ==============================================================================
 --- stable/8/sys/netinet/ipfw/ip_fw2.c	Thu Apr  7 08:32:53 2011	(r220414)
 +++ stable/8/sys/netinet/ipfw/ip_fw2.c	Thu Apr  7 11:13:50 2011	(r220415)
 @@ -1123,6 +1123,12 @@ do {								\
  				args->f_id._flags = TCP(ulp)->th_flags;
  				break;
  
 +			case IPPROTO_SCTP:
 +				PULLUP_TO(hlen, ulp, struct sctphdr);
 +				src_port = SCTP(ulp)->src_port;
 +				dst_port = SCTP(ulp)->dest_port;
 +				break;
 +
  			case IPPROTO_UDP:
  				PULLUP_TO(hlen, ulp, struct udphdr);
  				dst_port = UDP(ulp)->uh_dport;
 _______________________________________________
 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: ae 
State-Changed-When: Thu Apr 7 11:22:13 UTC 2011 
State-Changed-Why:  
Committed to head/ and stable/8. Thanks! 

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