Fixed binkp read deadlock #2 on some arches (aarch64)

master
Alexey Khromov 5 months ago
commit a1c93b8016

@ -668,12 +668,12 @@ case BPMSG_ADR: /* List of addresses */
if (bstate->address_established) {
PROTO_ERROR("remote tries to change address");
}
if( bstate->extracmd[0] !=-1 ) return 0; // suspend !!!
if( bstate->extracmd[0] != (char)-1 ) return 0; // suspend !!!
binkp_process_ADR(buf+1);
if( !state.n_remoteaddr ) {
log("error: remote did not supplied any addresses");
if( bstate->extracmd[0] !=-1 ) return 0; // suspend
if( bstate->extracmd[0] != (char)-1 ) return 0; // suspend
bstate->extracmd[0] = BPMSG_BSY;
strcpy(bstate->extracmd+1, "No addresses was presented");
bstate->extraislast = true;
@ -844,7 +844,7 @@ case BPMSG_OK: /* Password was acknowleged (data ignored) */
}
if (session_addrs_lock(state.remoteaddrs, state.n_remoteaddr)) {
log("error: unable to lock");
if (bstate->extracmd[0]!=-1) return 0;
if (bstate->extracmd[0]!= (char)-1) return 0;
bstate->extracmd[0] = BPMSG_BSY;
strcpy(bstate->extracmd+1, "All addresses are busy");
bstate->extraislast = true;

Loading…
Cancel
Save