--- ansh/src/utils.c 2011/10/14 12:03:10 1.1.1.1.2.11 +++ ansh/src/utils.c 2011/10/14 13:23:49 1.1.1.1.2.13 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ - * $Id: utils.c,v 1.1.1.1.2.11 2011/10/14 12:03:10 misho Exp $ + * $Id: utils.c,v 1.1.1.1.2.13 2011/10/14 13:23:49 misho Exp $ * ************************************************************************* The ELWIX and AITNET software is distributed under the following @@ -206,6 +206,8 @@ icmpRecv(int s, u_int * __restrict seq, u_short * __re VERB(3) LOG("Channel SECURED:: Plain text communication not supported at this moment ..."); return ANSH_FLG_ERR; } + if (ntohl(hdr->ansh_nonce) != *crypted) + VERB(4) LOG("Detect change of nonce from %x to %x", *crypted, ntohl(hdr->ansh_nonce)); *crypted = ntohl(hdr->ansh_nonce); } @@ -384,6 +386,8 @@ _pkt_Recv(u_char * __restrict buf, int rlen, u_int * _ VERB(3) LOG("Channel SECURED:: Plain text communication not supported at this moment ..."); return ANSH_FLG_ERR; } + if (ntohl(hdr->ansh_nonce) != *crypted) + VERB(4) LOG("Detect change of nonce from %x to %x", *crypted, ntohl(hdr->ansh_nonce)); *crypted = ntohl(hdr->ansh_nonce); } @@ -524,12 +528,15 @@ stopProcess(sched_root_task_t * __restrict root, proc_ if (p->proc_pid == pid) { break; } + VERB(3) LOG("pid=%d found=%p\n", pid, p); if (!p) return 1; ioFreePTY(p->proc_pty, p->proc_ttyname); - schedCancelby(root, NULL, CRITERIA_FD, (void*) ((intptr_t) p->proc_pty), NULL); + if (p->proc_pty) + schedCancelby(root, NULL, CRITERIA_FD, (void*) ((intptr_t) p->proc_pty), NULL); + p->proc_pty = 0; p->proc_pid = 0; p->proc_seq = 0; p->proc_flg = ANSH_FLG_EOF;