Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

#4494 closed defect (fixed)

pppd broken if serial driver can't handle big data

Reported by: Christian Mauderer Owned by: Christian Mauderer
Priority: normal Milestone:
Component: network/libbsd Version: 5
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

Cloned from #4493:


The current implementation of ppp assumes (in ppp_tty.c:pppstart) that sending characters via the termios device write function will send buffers of any length. That is not true for most drivers.

Devices that can only send one character at a time won't work with that at all. Devices that have a big enough FIFO might work most of the time. Devices that use a DMA for transmitting might work without problems.

Change History (5)

comment:1 Changed on 08/17/21 at 06:23:55 by Christian Mauderer

Owner: set to Christian Mauderer
Status: newassigned

comment:2 Changed on 08/17/21 at 06:27:01 by Chris Johns

Why is the termios driver a factor here?

How do you see this being solved?

comment:3 Changed on 08/17/21 at 06:36:23 by Christian Mauderer

I posted a patch set here: https://lists.rtems.org/pipermail/devel/2021-August/068890.html

The problem is that our pppd installs a line discipline that basically ignores all buffering of termios. Instead it directly uses the raw console driver write. There it just assumes that a write can write any number of characters without problems:

https://git.rtems.org/rtems-libbsd/tree/rtemsbsd/sys/net/ppp_tty.c?id=02373194fe0be1ef82db419bedbf9d6ffd31dc93#n646

Our device write doesn't return how many characters it was able to handle. Instead it provides that info to termios via the rtems_termios_dequeue_characters() function. But this information never reaches the pppstart function. Therefore I adapted the interface so that the information is passed to the pppstart and pppstart can process it.

The alternatives would have been to let the driver write return the number of characters (which would touch all drivers and maybe would be a problem sometimes) or completely rewrite the pppd to not use any line discipline functions (which would have touched a lot of code with so much edge cases that I'm definitively not able to test it thouroghly).

comment:4 Changed on 02/11/22 at 07:38:40 by Christian Mauderer <christian.mauderer@…>

In [changeset:"9942ff80c46d5658f22dc5ac9fae4dcaba4f9966/rtems" 9942ff80/rtems]:

Error: Processor CommitTicketReference failed
/data/trac/repo/rtems.git does not appear to be a Git repository.

comment:5 Changed on 02/11/22 at 07:43:22 by Christian Mauderer <christian.mauderer@…>

Resolution: fixed
Status: assignedclosed

In [changeset:"2ce166bd372320702c27b2c3980ca9192a60b159/rtems-libbsd" 2ce166bd/rtems-libbsd]:

Error: Processor CommitTicketReference failed
/data/trac/repo/rtems-libbsd.git does not appear to be a Git repository.
Note: See TracTickets for help on using tickets.