mirror of
https://github.com/yarrick/iodine.git
synced 2025-10-17 16:51:54 +00:00
start merging common and docs #76
This commit is contained in:

committed by
Erik Ekman

parent
92b160a416
commit
05e99c7a3f
15
src/common.c
15
src/common.c
@@ -333,3 +333,18 @@ errx(int eval, const char *fmt, ...)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int recent_seqno(int ourseqno, int gotseqno)
|
||||
/* Return 1 if we've seen gotseqno recently (current or up to 3 back).
|
||||
Return 0 if gotseqno is new (or very old).
|
||||
*/
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 4; i++, ourseqno--) {
|
||||
if (ourseqno < 0)
|
||||
ourseqno = 7;
|
||||
if (gotseqno == ourseqno)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user