Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 May 2001 05:48:22 -0400 (EDT)
From:      Sudish Joseph <sudish@mindspring.com>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/27767: PPPoE makes 32-bit assumptions and breaks on Alpha
Message-ID:  <200105300948.f4U9mMb00741@mindspring.com>

next in thread | raw e-mail | index | archive | help

>Number:         27767
>Category:       kern
>Synopsis:       PPPoE makes 32-bit assumptions and breaks on an Alpha
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 30 02:50:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Sudish Joseph
>Release:        FreeBSD 4.3-STABLE alpha
>Organization:
>Environment:
System: FreeBSD aleph.weenal.com 4.3-STABLE FreeBSD 4.3-STABLE #0: Wed May 30 02:26:09 GMT 2001 root@aleph.weenal.com:/usr/obj/usr/src/sys/SUDISH alpha
>Description:
/usr/src/sys/netgraph/ng_pppoe.c relies on the IA-32 assumption that
sizeof(char *) == 4.  It attempts to stuff a pointer into the 32-bit 
PPPoE tag field.  This breaks under alpha, where a pointer is 64 bits.

The kluge I use to workaround this is included below.  It's not a real
fix (which would be to use an index into a table of pointers as the tag
field or something similar), however, it allows me to get a working network
for now.

All the alpha-specific kluge below does is to mask out the upper 32 bits.
It works, given that all of netgraph is in the same 32-bit segment.  But,
obviously, this is not a general fix.

With the kluge below, and the /usr/sbin/ppp fix that I send-pr'ed just
prior to this message, I now have a working DSL connection from FreeBSD-
alpha.  Very cool!
>How-To-Repeat:
Attempt to use netgraph-based PPPoE on an Alpha.  It will fail.
>Fix:
This is not a true fix, but an alpha-specific workaround.  The patch 
below does point out the nature of the problem.


--- /sys/netgraph/ng_pppoe.c	Sat Nov  4 08:23:16 2000
+++ /sys/netgraph/ng_pppoe.c	Wed Apr  4 22:59:52 2001
@@ -441,7 +441,7 @@
 		if ((hook->private == &privp->debug_hook)
 		||  (hook->private == &privp->ethernet_hook)) 
 			continue;
-		if (uniq.pointer == hook->private)
+		if (uniq.pointer == (void *)(((long) hook->private) << 32))
 			break;
 	}
 	return (hook);
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200105300948.f4U9mMb00741>