- printf("keepalive: mineseen=0x%08x, yourseen=0x%08x",
- EXTRACT_32BITS(&slarp->un.keep.myseq),
- EXTRACT_32BITS(&slarp->un.keep.yourseq));
- printf(", reliability=0x%04x, t1=%d.%d",
- EXTRACT_16BITS(&slarp->un.keep.rel),
- EXTRACT_16BITS(&slarp->un.keep.t1),
- EXTRACT_16BITS(&slarp->un.keep.t2));
+ printf("keepalive: mineseen=0x%08x, yourseen=0x%08x, reliability=0x%04x",
+ EXTRACT_32BITS(&slarp->un.keep.myseq),
+ EXTRACT_32BITS(&slarp->un.keep.yourseq),
+ EXTRACT_16BITS(&slarp->un.keep.rel));
+
+ if (length >= SLARP_MAX_LEN) { /* uptime-stamp is optional */
+ cp += SLARP_MIN_LEN;
+ if (!TTEST2(*cp, 4))
+ goto trunc;
+ sec = EXTRACT_32BITS(cp) / 1000;
+ min = sec / 60; sec -= min * 60;
+ hrs = min / 60; min -= hrs * 60;
+ days = hrs / 24; hrs -= days * 24;
+ printf(", link uptime=%ud%uh%um%us",days,hrs,min,sec);
+ }