Reduce differences between the two pfctl_osfp.c files.

The pfctl_show_fingerprints() function has changed, the new one from
pfctl uses pfctl_print_title(), which is defined in a different file
(pfctl.c), not available in tcpdump.

tcpdump doesn't use pfctl_show_fingerprints() anyway, so update the
function to minimize the diff, and comment it out.


Index: usr.sbin/tcpdump/pfctl_osfp.c
===================================================================
RCS file: /cvs/src/usr.sbin/tcpdump/pfctl_osfp.c,v
retrieving revision 1.12
diff -u -p -r1.12 pfctl_osfp.c
--- usr.sbin/tcpdump/pfctl_osfp.c       28 May 2017 07:40:12 -0000      1.12
+++ usr.sbin/tcpdump/pfctl_osfp.c       28 May 2017 08:23:37 -0000
@@ -296,16 +296,29 @@ pfctl_load_fingerprints(int dev, int opt
        return (0);
 }
 
+/* 
+ * comment out pfctl_show_fingerprints() when syncing with
+ * pfctl/pfctl_osfp.c, as it's unused here and uses pfctl_print_title()
+ * which is not available in tcpdump
+*/
+#if 0
 /* List the fingerprints */
 void
 pfctl_show_fingerprints(int opts)
 {
-       printf("Passive OS Fingerprints:\n");
-       printf("\tClass\tVersion\tSubtype(subversion)\n");
-       printf("\t-----\t-------\t-------------------\n");
-       sort_name_list(opts, &classes);
-       print_name_list(opts, &classes, "\t");
+       if (LIST_FIRST(&classes) != NULL) {
+               if (opts & PF_OPT_SHOWALL) {
+                       pfctl_print_title("OS FINGERPRINTS:");
+                       printf("%u fingerprints loaded\n", fingerprint_count);
+               } else {
+                       printf("Class\tVersion\tSubtype(subversion)\n");
+                       printf("-----\t-------\t-------------------\n");
+                       sort_name_list(opts, &classes);
+                       print_name_list(opts, &classes, "");
+               }
+       }
 }
+#endif
 
 /* Lookup a fingerprint */
 pf_osfp_t


-- 
Michal Mazurek

Reply via email to