Back to
Sony Ericsson GC82 on Mac OS X
Recompiling pppd for the Sony Ericsson GCxx series of
GPRS/EGPRS/EDGE cards:
Note: these instructions are now deprecated.
There's a
much simpler way
to accomplish essentially the same results. They're left here
for those of you who prefer to do things the hard way, or who
just like to see the hoops people jump through before they find
the easier solutions.
The GC82, like its predecessor the GC75, appears to have a
PPP stack built into the card which sends out an illegal remote
address (127.0.0.2) as part of its PPP setup (a
relevant
RFC
says "no addresses within this block should ever appear on any
network anywhere"). This works just fine on Windows but fails
on Mac OS X (and will probably fail on any other UNIX-style
pppd). In order to get this to work you have to download the
source for ppp that goes with your version of Mac OS X, patch
the auth.c file, build the "pppd" target, and replace your
existing pppd with the one you've compiled.
Note that you should enter the commands between backticks
(``)
exactly
as they appear here.
- MAKE A BACKUP OF THE ORIGINAL.
- Create a backup directory somewhere you'll
remember.
- Open up a Terminal window. Become root (if you haven't
enabled the root account -- the default setup -- type `sudo
su -` and enter your password.
- In that Terminal window, change to the backup directory
you created in step 1a. To avoid typing in the full path to
the directory, you can type just the letters `cd ` (the
space is important) and then drag the folder from a Finder
window to your Terminal, which will auto-fill the path.
(Hit 'return.')
- Copy the original to your backup directory with the
command: `cp /usr/sbin/pppd .` (the space and the period
after "pppd" are important)
- Verify that the copy looks like the original by doing
an `ls -l` on both /usr/sbin/pppd and the pppd in your
backup directory. If they don't match, go back to step 1b.
If you've done this a few times, consider professional
help.
- MAKE A BACKUP OF THE ORIGINAL. REALLY.
- Install Xcode if you haven't.
- Download the appropriate source code for ppp for your
version of OS X from
Apple's Darwin source page
(registration required, but I think your existing apple.com
registration might work). Select your version of OS X, then
scroll down until you see ppp-<version> and click the
corresponding ".tar.gz" link to download it.
- Expand the tarball if your browser didn't do it already.
You will end up with a folder named ppp-<version> in
your downloads folder. Copy the "attws.patch" file from the
"Sony Ericsson GC82" folder created in the original
instructions into the top level of that ppp-<version>
directory.
- Go back to your Terminal window, and `cd` to the ppp
directory created above. Remember the Finder drag trick.
- In the Terminal window, type `patch -p0 <
attws.patch`. If you don't see "patching file
./Helpers/pppd/auth.c" something has gone wrong. You can
manually edit the file in step 9.
- In the Finder, double-click on the "ppp.pbproj" file in
the ppp source directory. Xcode will open and cogitate for a
while as it indexes the project.
- Double-click the "auth.c" file in the list on the right,
and confirm that it contains the following code:
bad_ip_adrs(addr)
u_int32_t addr;
{
addr = ntohl(addr);
//hack for AT&T's 127.0.0.2 remote address
//return (addr >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET
//|| IN_MULTICAST(addr) || IN_BADCLASS(addr);
return IN_MULTICAST(addr) || IN_BADCLASS(addr);
}
- Close the source code editor. Save your changes, if you
made any.
- Change the build target to "pppd (Tool)" using the
pulldown menu at the top left. Then click the hammer icon,
press cmd-B, or select "Build" from the "Build" menu.
- In that Terminal window, `cd` to the "build" directory
that now exists in your ppp source folder.
- There is no step 13. YOU MADE A BACKUP OF THE ORIGINAL,
RIGHT?
- In the Terminal, copy the new pppd over the original: `cp
pppd /usr/sbin/`.
- If you have a dialup account, now would be a good time to
test it to make sure your new pppd didn't break something.
- Return to
step 4
in the original instructions.