Re: connect to internet via android phone as usb-modem



On Wed, 2011-03-16 at 23:16 +0100, Torsten Spindler wrote:
> On Wed, 2011-03-16 at 15:50 -0500, Dan Williams wrote:
> ...
> > That said, the best way to go about this is likely to use udev scripts
> > to initially create the easytether0 interface, and then we could add
> > some custom code to NM to recognize the easytether0 interface as a
> > normal ethernet device and run DHCP on it.  That wouldn't be *too* hard,
> > probably < 30 lines of code.  It would involve using g_str_has_prefix()
> > looking for easytether in the nm-udev-manager.c code, and if so,
> > bypassing some of the udev /sysfs hierarchy checks that determine
> > hardware relationships and device attributes like driver and
> > description.  That's not something we should be doing for most "virtual"
> > network interfaces, but it's probably OK in the case of easytether.
> 
> Thanks for the advice where to patch network manager. Attached is a very
> first version, plus a basic udev rule for a Motorola Milestone and
> connect script. It works fine on my Ubuntu 10.04 machine right now,
> though it could use some polishing.

Two suggestions for the patch:

1) Kill the first hunk, lets just set a driver name anyway

2) In the second hunk, instead or printing a warning, lets do something
like this:

if (!driver) {
   if (g_str_has_prefix (ifname, "easytether"))
      driver = "easytether";
   else {
      nm_log_warn (LOGD_HW, "%s: couldn't determine device driver; ignoring...", path);
      goto out;
   }
}

That makes the hack more contained and gets rid of some of the
extraneous logging.  If you rework the patch and it works fine for you,
I'll merge it.  Thanks!

Dan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]