Bug#606338: ax25ipd transmission bug
Am Donnerstag, den 09. Dezember 2010 um 01:03:50 Uhr, schrieb John Goerzen <jgoerzen@complete.org> in <[🔎] 4D001CE6.7050804@complete.org>:
> On 12/08/2010 03:00 PM, Thomas Osterried wrote:
> > No. But you was the wone who suggestet the patch
> > "- if (*iframe == '\0' || *iframe == 0x10) {
> > + if (1) {
> > "
>
> After Ralf explained it, I'm in agreement with you that it's wrong.
>
> > which would lead ax25ipd to receive frames regardless of their kiss-port-tag (which would be wrong), and discussed later to let it receive at least frames with kiss-byte 0 ||>1.
> > Now you describe your setup where no multiport tnc is in use. Thus the whole discussion seems to be useless.
>
> I don't think it is useless, because ax25ipd was refusing to transmit my
> packets on IP, and I still believe it was because of this problem. I
> have no idea why kissattach or kissnetd was setting those bits, or how
> to control it.
Which kernel version do you use?
If your way is
kernel-ax25 -> kissattach -> pty -> ax25ipd -> inet
then kiss packets from kernel-ax25 -> pty never have the kiss byte != \0,
except kiss param commands (i.e. setting txdeleay).
If, as you note, your hack fixes your problem, I'm very interested in what goes deeply wrong in your system. But this is not a fault of ax25ipd.
> >> I can say that whatever ax25ipd is sending back, kissattach finds fine.
> >> So your& 0xf will solve my problem completely.
> >
> > Whose& 0xf?
>
> Pardon me, that was Ralf's in <[🔎] 20101208153841.GA31702@linux-mips.org>,
> where he wrote:
>
> | I'm just wondering why the test isn't (*iframe & 0xf) == 0 which would
> | handle the full number of possible 16 possible TNCs.
>
> So if you just take the "if (*iframe == '\0' || *iframe == 0x10) {" line
> and replace it with "if ((*iframe & 0xf) == 0) {" it solves the bug and
> causes no further damage.
Ralf has referenced the specs:
Command Function Comments
0 Data frame The rest of the frame is data to
be sent on the HDLC channel.
1 TXDELAY The next byte is the transmitter
keyup delay in 10 ms units.
The default start-up value is 50
(i.e., 500 ms).
[..]
6 SetHardware Specific for each TNC. In the
TNC-1, this command sets the
modem speed. Other implementations
may use this function for other
hardware-specific functions.
FF Return Exit KISS and return control to a
higher-level program. This is useful
only when KISS is incorporated
into the TNC along with other
applications.
->
"if ((*iframe & 0xf) == 0)"
is not the correct way. Because:
1. it will discard all kiss frames with kiss byte == 0 (!!!) - these are all ax25 packets. This will break every system except yours.
2. You only pass along kiss commands like the setting of txdelay, slottime, etc.. via ax25ipd to your ip-neighbor (regardless of the kiss-port (upper 4 bit)). This is really not what ax25ipd is for.
3. The number > 15 (upper 4 bits) are for multi-port-kiss-frames. This is (*iframe >> 4) != 0. [And btw, 0xffXX should also never occur in the wild).
AX25-Packets with kiss-byte i.E. set to 0x1 should never happen. Simply because it's a protocol violation. Kiss-Bytes with number 1-15 (kiss commands) are followed by exactly one byte, and never by an ax25 packet.
Could you send us a dump what's really coming from the pty?
73,
- Thomas dl9sau
Reply to: