Race condition in NetworkManager with PPPoE

Issues related to configuring your network
Post Reply
danfulger
Posts: 1
Joined: 2021/12/14 21:34:07

Race condition in NetworkManager with PPPoE

Post by danfulger » 2021/12/14 22:44:49

I wrote a quick and dirty fix; it's not perfect, but the PPP connection failure rate dropped from 100% to something like 20%.

This happened to me after an upgrade of the ISP's PPPoE servers, before I had 0% connection failures.
Probably the new ISP servers are faster.

The patch is for CentOS 7.9 (NetworkManager-1.18.8.tar.xz).

Code: Select all

--- src/ppp/nm-pppd-plugin.c	2020-05-29 14:45:39.000000000 +0300
+++ src/ppp/nm-pppd-plugin.c	2021-11-25 23:47:34.646270979 +0200
@@ -30,6 +30,7 @@
 #include <net/if.h>
 #include <arpa/inet.h>
 #include <dlfcn.h>
+#include <sys/select.h>
 
 #define INET6
 #include <pppd/eui64.h>
@@ -56,6 +57,11 @@
 	char *ppp_phase;
 	int index;
 
+	struct timeval wait_interval;
+	wait_interval.tv_sec = 0;
+	wait_interval.tv_usec = 200*1000;
+	fprintf(stderr, "wait=%d\n", select(0, NULL, NULL, NULL, &wait_interval));
+
 	g_return_if_fail (G_IS_DBUS_PROXY (proxy));
 
 	switch (arg) {
@@ -169,6 +175,11 @@
 	GVariantBuilder builder;
 	guint32 pppd_made_up_address = htonl (0x0a404040 + ifunit);
 
+	struct timeval wait_interval;
+	wait_interval.tv_sec = 0;
+	wait_interval.tv_usec = 200*1000;
+	fprintf(stderr, "wait=%d\n", select(0, NULL, NULL, NULL, &wait_interval));
+
 	g_return_if_fail (G_IS_DBUS_PROXY (proxy));
 
 	g_message ("nm-ppp-plugin: (%s): ip-up event", __func__);

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Race condition in NetworkManager with PPPoE

Post by TrevorH » 2021/12/15 12:24:08

CentOS is a rebuild of the sources used to create RHEL. To get bugs fixed you need to report them via bugzilla.redhat.com.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply