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.

  1. MAKE A BACKUP OF THE ORIGINAL.
    1. Create a backup directory somewhere you'll remember.
    2. 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.
    3. 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.')
    4. Copy the original to your backup directory with the command: `cp /usr/sbin/pppd .` (the space and the period after "pppd" are important)
    5. 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.

  2. MAKE A BACKUP OF THE ORIGINAL. REALLY.
  3. Install Xcode if you haven't.
  4. 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.
  5. 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.
  6. Go back to your Terminal window, and `cd` to the ppp directory created above. Remember the Finder drag trick.
  7. 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.
  8. 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.

    Main Xcode window

  9. 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);
    }
    

    auth.c in convenient .jpg form

  10. Close the source code editor. Save your changes, if you made any.
  11. 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.

    Selecting pppd as the build target

  12. In that Terminal window, `cd` to the "build" directory that now exists in your ppp source folder.

    ppp source folder with new build directory

  13. There is no step 13. YOU MADE A BACKUP OF THE ORIGINAL, RIGHT?
  14. In the Terminal, copy the new pppd over the original: `cp pppd /usr/sbin/`.
  15. 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.
  16. Return to step 4 in the original instructions.