- if (vflag > 1)
- printf("O:%08x ", EXTRACT_32BITS(cp));
- cp += 4; /* skip offset */
+ checksum = EXTRACT_16BITS(cp);
+ offset = EXTRACT_16BITS(cp + 2);
+
+ if (flags & GRE_CP) {
+ /* Checksum present */
+
+ /* todo: check checksum */
+ if (vflag > 1)
+ printf("C:%04x ", checksum);
+ }
+ if (flags & GRE_RP) {
+ /* Offset present */
+
+ if (vflag > 1)
+ printf("O:%04x ", offset);
+ }
+ cp += 4; /* skip checksum and offset */