Skip to content

Fix bug with packet size negotiation - #558

Merged
davidrg merged 1 commit into
davidrg:masterfrom
jgoerzen:jgoerzen/eksw
Aug 8, 2026
Merged

Fix bug with packet size negotiation#558
davidrg merged 1 commit into
davidrg:masterfrom
jgoerzen:jgoerzen/eksw

Conversation

@jgoerzen

@jgoerzen jgoerzen commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

This re-implements
OpenKermit/ckermit@0eef9a1 on this tree.

This was detected after OpenKermit's ckermit test suite added eksw compatibility tests. A stall was observed after sending several packets to E-Kermit (eksw). C-Kermit 9.0.302 tested working with it.

The bug was tracked down to a change in C-Kermit 9.0 edit 305(alpha05) of 2021-11-16. In bgetpkt(), it changed:

+#ifdef COMMENT
+    /* No - bufmax is a parameter */
     bufmax = maxdata();                        /* Get maximum data length */
+#endif

While the comment that bufmax is a parameter is correct, the change to set it to maxdata() was incorrect, since maxdata() accounts for overhead and bufmax does not. This resulted in packets a few bytes larger than the receiver had signaled acceptance of.

C-Kermit supports such very large packets anyhow that this was never detected when talking to other C-Kermits.

With this change, proper communication with ekermit (eksw) was restored.

This re-implements
OpenKermit/ckermit@0eef9a1
on this tree.

This was detected after OpenKermit's ckermit test suite added eksw
compatibility tests.  A stall was observed after sending several packets
to E-Kermit (eksw).  C-Kermit 9.0.302 tested working with it.

The bug was tracked down to a change in C-Kermit 9.0 edit 305(alpha05)
of 2021-11-16.  In bgetpkt(), it changed:

+#ifdef COMMENT
+    /* No - bufmax is a parameter */
     bufmax = maxdata();                        /* Get maximum data length */
+#endif

While the comment that bufmax is a parameter is correct, the change to
set it to maxdata() was incorrect, since maxdata() accounts for overhead
and bufmax does not.  This resulted in packets a few bytes larger than
the receiver had signaled acceptance of.

C-Kermit supports such very large packets anyhow that this was never
detected when talking to other C-Kermits.

With this change, proper communication with ekermit (eksw) was restored.
@jgoerzen

jgoerzen commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

BTW I am happy to do whatever I can to help with integration with OpenKermit and such.

@davidrg

davidrg commented Aug 8, 2026

Copy link
Copy Markdown
Owner

This looks like the fix for the bug I logged over here: KermitProject/ckermit#19 - seems you've confirmed my suspicion that packet size negotiation was broken by this too.

@davidrg
davidrg merged commit c7375ed into davidrg:master Aug 8, 2026
32 checks passed
@jgoerzen
jgoerzen deleted the jgoerzen/eksw branch August 8, 2026 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants