]> The Tcpdump Group git mirrors - tcpdump/commitdiff
From Wesley Griffin <[email protected]>: print out the
authorguy <guy>
Fri, 7 Apr 2006 08:58:43 +0000 (08:58 +0000)
committerguy <guy>
Fri, 7 Apr 2006 08:58:43 +0000 (08:58 +0000)
DNSSEC OK bit (RFC3225) which is encoded in the TTL field of the OPT
pseudo RR.

print-domain.c

index 56e3fbabdb6cdaddbaf6474c4b71e16c7ad30e95..3db942720f73e901237df5f80f482dadc9e61644 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-domain.c,v 1.89.2.2 2006-04-07 08:48:09 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-domain.c,v 1.89.2.3 2006-04-07 08:58:43 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -347,7 +347,7 @@ ns_qprint(register const u_char *cp, register const u_char *bp, int is_mdns)
 static const u_char *
 ns_rprint(register const u_char *cp, register const u_char *bp, int is_mdns)
 {
-       register u_int class;
+       register u_int class, opt_flags = 0;
        register u_short typ, len;
        register const u_char *rp;
 
@@ -372,7 +372,12 @@ ns_rprint(register const u_char *cp, register const u_char *bp, int is_mdns)
                printf(" %s", tok2str(ns_class2str, "(Class %d)", class));
 
        /* ignore ttl */
-       cp += 4;
+       cp += 2;
+       /* if T_OPT, save opt_flags */
+       if (typ == T_OPT)
+               opt_flags = EXTRACT_16BITS(cp);
+       /* ignore rest of ttl */
+       cp += 2;
 
        len = EXTRACT_16BITS(cp);
        cp += 2;
@@ -489,6 +494,8 @@ ns_rprint(register const u_char *cp, register const u_char *bp, int is_mdns)
 
        case T_OPT:
                printf(" UDPsize=%u", class);
+               if (opt_flags & 0x8000)
+                       printf(" OK");
                break;
 
        case T_UNSPECA:         /* One long string */