Comment 15 for bug 147119

Revision history for this message
bendis (bendis) wrote :

Hi,

I also experience this issue, on Kubuntu Hardy beta. I looked in th source package and successfully tracked the error down - the problem is in the debian patch file "debian/patches/05-debian_backend.patch". NetworkManager uses ifup/ifdown to manage dialup connections and the original debian backend does not check the status code of these commands. The mentioned patch attempts to add such a check - but with no luck. Let's see:

@@ -587,12 +641,18 @@
                if (strcmp (dialup, config->name) == 0)
                {
                        char *cmd;
+ int status;

                        nm_info ("Activating dialup device %s (%s) ...", dialup, (char *) config->data);
                        cmd = g_strdup_printf ("/sbin/ifup %s", (char *) config->data);
                        nm_spawn_process (cmd);
                        g_free (cmd);
- ret = TRUE;
+ if (status == 0) {
+ ret = TRUE;
+ } else {
+ nm_warning ("Couldn't activate dialup device %s (%s) - %d", dialup, (char *) config->data, status);
+ ret = FALSE;
+ }
                        break;
                }
        }

As you can see, the patch adds the status variable and checks its value - but the status variable is never assigned! That's why the NetworkManager log shows such bogus return codes:

>
> Sep 29 23:50:51 nimitz NetworkManager: <WARN> nm_system_activate_dialup(): Couldn't activate dialup device ukfsn via Modem (ppp) - ***134853016***
>

To fix this, the return value from nm_spawn_process must be assigned to the status variable (in nm_system_deactivate_dialup and nm_system_activate_dialup functions).

                        status = nm_spawn_process (cmd);

The fixed debian patch is attached to this comment.