diff options
author | Dan Williams <dcbw@redhat.com> | 2013-02-12 15:24:15 -0600 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2013-02-12 15:26:21 -0600 |
commit | 625e1c4884215bb9989dad6c9868c06ba76a4d94 (patch) | |
tree | fc5d6b0fad034bb67c14d19bb967dfc2fb20c0c9 /src | |
parent | 67fcac254150a34c7c1467a7857cad7509ca41ff (diff) |
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}%~'
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-serial-port.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mm-serial-port.c b/src/mm-serial-port.c index 87f06e27..2971273e 100644 --- a/src/mm-serial-port.c +++ b/src/mm-serial-port.c @@ -767,6 +767,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; |