kern/60183: No WCCPv2 support in gre

John Narron jnarron at cdsinet.net
Fri Dec 12 09:40:23 PST 2003


>Number:         60183
>Category:       kern
>Synopsis:       No WCCPv2 support in gre
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 12 09:40:18 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     John Narron
>Release:        FreeBSD 5.1-RELEASE-p11 i386
>Organization:
CDS/CDSinet, LLC
>Environment:
System: FreeBSD radius2.cdsinet.net 5.1-RELEASE-p11 FreeBSD 5.1-RELEASE-p11 #14: Thu Dec 11 16:16:13 CST 2003 zeek at radius2.cdsinet.net:/usr/obj/usr/src/sys/RADIUS i386


>Description:
	The gre driver has support for WCCP, but lacks WCCPv2 support.  WCCPv2 packets, when arriving on a gre device, appear as IPv0 packets.

>How-To-Repeat:
	Can't repeat something that isn't supported now can we?
>Fix:

	Attached is a patch to check if m->m_data+hlen is a IPv4 header.  If so its assumed the packet is WCCPv1, otherwise its WCCPv2 and hlen is incremented by 4.


--- ip_gre.c    Fri Dec 12 16:50:49 2003
+++ ip_gre.c.wccpv2     Fri Dec 12 16:58:13 2003
@@ -172,8 +172,26 @@
 
                switch (ntohs(gip->gi_ptype)) { /* ethertypes */
                case ETHERTYPE_IP: /* shouldn't need a schednetisr(), as */
+                       isr = NETISR_IP;
+                       break;
                case WCCP_PROTOCOL_TYPE: /* we are in ip_input */
-                       isr = NETISR_IP;        
+                       isr = NETISR_IP;
+                       /*
+                        * jnarron at cdsinet.net
+                        * WCCPv1 and WCCPv2 packet encapsulations differ by 4 octets
+                        * WCCPv2 adds:
+                        *       octet 0: Flags
+                        *   octet 1: Service ID
+                        *   octet 2: Reserved?
+                        *   octet 3: Primary bucket index
+                        *
+                        * So far I haven't found any use for those 4 octets, so for now
+                        * we just strip them out and move on.
+                        */ 
+
+                       if(!((*(m->m_data + hlen)) & 0x40))
+                               hlen += 4;
+
                        break;
 #ifdef NETATALK
                case ETHERTYPE_ATALK:


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list