summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2013-02-12 15:24:15 -0600
committerDan Williams <dcbw@redhat.com>2013-02-12 15:24:15 -0600
commita277e835796c881fd43a7fcc265ccc1f6655e67b (patch)
treee8aa47956764e0165c3fd78590c18694ac390077
parent8027b5a90238472a8d97e4fd14d024321747fc6e (diff)
downloadModemManager-a277e835796c881fd43a7fcc265ccc1f6655e67b.tar.gz
serial-port: don't steal data from PPP when connected
There was a race where if PPP was slow to start, MM could read the first bits of PPP from the port, which MM shouldn't really do. So if the port is connected, don't read any data and let pppd do its thing. See the logs in https://bugzilla.gnome.org/show_bug.cgi?id=624956#c10 for an example of this: DEBUG: <1280300196.929489> (ttyACM0): <-- '<CR><LF>CONNECT<CR><LF>' DEBUG: <1280300196.929761> (ttyACM0): port now connected DEBUG: <1280300196.929853> Modem /org/freedesktop/ModemManager/Modems/0: state changed (connecting -> connected) DEBUG: <1280300196.929954> (ttyACM0): simple connect state 6 DEBUG: <1280300196.933432> (ttyACM0): <-- '~\-1}#\-64!}!} } }2}#}$\-64#}!}$}%\-36}"}&} }*} } g}%~'
-rw-r--r--src/mm-serial-port.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mm-serial-port.c b/src/mm-serial-port.c
index 497d14cb7..36f401aec 100644
--- a/src/mm-serial-port.c
+++ b/src/mm-serial-port.c
@@ -713,6 +713,10 @@ data_available (GIOChannel *source,
if (info && (info->started == TRUE) && (info->done == FALSE))
return TRUE;
+ /* Don't steal data from PPP if we're connected */
+ if (mm_port_get_connected (MM_PORT (self)))
+ return TRUE;
+
do {
GError *err = NULL;