1
1
//
2
2
// This file is part of Dire Wolf, an amateur radio packet TNC.
3
3
//
4
- // Copyright (C) 2016 John Langner, WB2OSZ
4
+ // Copyright (C) 2016, 2017 John Langner, WB2OSZ
5
5
//
6
6
// This program is free software: you can redistribute it and/or modify
7
7
// it under the terms of the GNU General Public License as published by
@@ -1011,6 +1011,13 @@ void dl_disconnect_request (dlq_item_t *E)
1011
1011
1012
1012
case state_2_awaiting_release :
1013
1013
{
1014
+ // We have previously started the disconnect sequence and are waiting
1015
+ // for a UA from the other guy. Meanwhile, the application got
1016
+ // impatient and sent us another disconnect request. What should
1017
+ // we do? Ignore it and let the disconnect sequence run its
1018
+ // course? Or should we complete the sequence without waiting
1019
+ // for the other guy to ack?
1020
+
1014
1021
// Erratum. Flow chart simply says "DM (expedited)."
1015
1022
// This is the only place we have expedited. Is this correct?
1016
1023
@@ -1021,6 +1028,13 @@ void dl_disconnect_request (dlq_item_t *E)
1021
1028
packet_t pp = ax25_u_frame (S -> addrs , S -> num_addr , cr , frame_type_U_DM , p , nopid , NULL , 0 );
1022
1029
lm_data_request (S -> chan , TQ_PRIO_0_HI , pp ); // HI means expedited.
1023
1030
1031
+ // Erratum: Shouldn't we inform the user when going to disconnected state?
1032
+ // Notifying the application, here, is my own enhancement.
1033
+
1034
+ text_color_set (DW_COLOR_INFO );
1035
+ dw_printf ("Stream %d: Disconnected from %s.\n" , S -> stream_id , S -> addrs [PEERCALL ]);
1036
+ server_link_terminated (S -> chan , S -> client , S -> addrs [PEERCALL ], S -> addrs [OWNCALL ], 0 );
1037
+
1024
1038
STOP_T1 ;
1025
1039
enter_new_state (S , state_0_disconnected , __func__ , __LINE__ );
1026
1040
}
@@ -2209,7 +2223,14 @@ static void i_frame (ax25_dlsm_t *S, cmdres_t cr, int p, int nr, int ns, int pid
2209
2223
// Look carefully. The original had two tiny differences between the two states.
2210
2224
// In the 2006 version, these differences no longer exist.
2211
2225
2212
- if (info_len >= 0 && info_len <= S -> n1_paclen ) {
2226
+ // Erratum: SDL asks: Is information field length <= N1 (paclen).
2227
+ // (github issue 102 - Thanks to KK6WHJ for pointing this out.)
2228
+ // Just because we are limiting the size of our transmitted data, it doesn't mean
2229
+ // that the other end will be doing the same. With v2.2, the XID frame can be
2230
+ // used to negotiate a maximum info length but with v2.0, there is no way for the
2231
+ // other end to know our paclen value.
2232
+
2233
+ if (info_len >= 0 && info_len <= AX25_MAX_INFO_LEN ) {
2213
2234
2214
2235
if (is_good_nr (S ,nr )) {
2215
2236
@@ -2286,7 +2307,7 @@ static void i_frame (ax25_dlsm_t *S, cmdres_t cr, int p, int nr, int ns, int pid
2286
2307
// Wouldn't even get to CRC check if not octet aligned.
2287
2308
2288
2309
text_color_set (DW_COLOR_ERROR );
2289
- dw_printf ("Stream %d: AX.25 Protocol Error O: Information part length, %d, not in range of 0 thru %d.\n" , S -> stream_id , info_len , S -> n1_paclen );
2310
+ dw_printf ("Stream %d: AX.25 Protocol Error O: Information part length, %d, not in range of 0 thru %d.\n" , S -> stream_id , info_len , AX25_MAX_INFO_LEN );
2290
2311
2291
2312
establish_data_link (S );
2292
2313
S -> layer_3_initiated = 0 ;
0 commit comments