[asterisk-bugs] [JIRA] (DAHLIN-381) Bypassed HDLC handler for outgoing packets

Alexei A Smekalkine (JIRA) noreply at issues.asterisk.org
Sun Aug 30 11:46:43 CDT 2020


     [ https://issues.asterisk.org/jira/browse/DAHLIN-381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexei A Smekalkine updated DAHLIN-381:
---------------------------------------

    Description: 
The HDLC encapsulation module can add its own headers and trailers to the packet. For correct operation in this case, it is necessary to send a packet from DAHDI to the appropriate HDLC handler. The HDLC handler, in turn, should call the device driver procedure to transfer the packet.

An example of such a module is our [Cisco HDLC Ethernet encapsulation|https://github.com/ikle/ds/blob/master/linux/hdlc_cisco_eth.c#L80].

Thus, for correct processing of outgoing packets, we should use function hdlc_start_xmit from Linux HDLC stack as a ndo_start_xmit procedure.

(Note that if the protocol handler does not provide a xmit procedure, then function hdlc_start_xmit will call the hardware driver directly.)
    
In the case of DAHDI, the packet transfer procedure (device driver xmit procedure) is set in function dahdi_ioctl_chanconfig to dahdi_xmit:
{code}
dev_to_hdlc(chan->hdlcnetdev->netdev)->xmit = dahdi_xmit;
{code}

P.S. [The attached patch|^0001-dahdi-base-netdev-send-frame-via-protocol-handlers-f.patch] has beed tested on real hardware and used in production for more then two years.

  was:
The HDLC encapsulation module can add its own headers and trailers to the packet. For correct operation in this case, it is necessary to send a packet from DAHDI to the appropriate HDLC handler. The HDLC handler, in turn, should call the device driver procedure to transfer the packet.

An example of such a module is our [Cisco HDLC Ethernet encapsulation|https://github.com/ikle/ds/blob/master/linux/hdlc_cisco_eth.c#L80].

Thus, for correct processing of outgoing packets, we should use function hdlc_start_xmit from Linux HDLC stack as a ndo_start_xmit procedure.

(Note that if the protocol handler does not provide a xmit procedure, then function hdlc_start_xmit will call the hardware driver directly.)
    
In the case of DAHDI, the packet transfer procedure (device driver xmit procedure) is set in function dahdi_ioctl_chanconfig to dahdi_xmit:
{code}
dev_to_hdlc(chan->hdlcnetdev->netdev)->xmit = dahdi_xmit;
{code}

P.S. [Attached patch|^0001-dahdi-base-netdev-send-frame-via-protocol-handlers-f.patch] has beed tested on real hardware and used in production for more then two years.


> Bypassed HDLC handler for outgoing packets
> ------------------------------------------
>
>                 Key: DAHLIN-381
>                 URL: https://issues.asterisk.org/jira/browse/DAHLIN-381
>             Project: DAHDI-Linux
>          Issue Type: Bug
>      Security Level: None
>          Components: dahdi (the module)
>    Affects Versions: 2.11.1, 3.0.0, 3.1.0
>            Reporter: Alexei A Smekalkine
>            Assignee: Keith Morgan
>              Labels: patch
>         Attachments: 0001-dahdi-base-netdev-send-frame-via-protocol-handlers-f.patch
>
>
> The HDLC encapsulation module can add its own headers and trailers to the packet. For correct operation in this case, it is necessary to send a packet from DAHDI to the appropriate HDLC handler. The HDLC handler, in turn, should call the device driver procedure to transfer the packet.
> An example of such a module is our [Cisco HDLC Ethernet encapsulation|https://github.com/ikle/ds/blob/master/linux/hdlc_cisco_eth.c#L80].
> Thus, for correct processing of outgoing packets, we should use function hdlc_start_xmit from Linux HDLC stack as a ndo_start_xmit procedure.
> (Note that if the protocol handler does not provide a xmit procedure, then function hdlc_start_xmit will call the hardware driver directly.)
>     
> In the case of DAHDI, the packet transfer procedure (device driver xmit procedure) is set in function dahdi_ioctl_chanconfig to dahdi_xmit:
> {code}
> dev_to_hdlc(chan->hdlcnetdev->netdev)->xmit = dahdi_xmit;
> {code}
> P.S. [The attached patch|^0001-dahdi-base-netdev-send-frame-via-protocol-handlers-f.patch] has beed tested on real hardware and used in production for more then two years.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list