1 /* $OpenBSD: pf_osfp.c,v 1.29 2014/07/22 11:06:10 mpi Exp $ */ 2 3 /* 4 * Copyright (c) 2003 Mike Frantzen <frantzen@w4g.org> 5 * 6 * Permission to use, copy, modify, and distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 * 18 */ 19 20 #include <sys/param.h> 21 #include <sys/socket.h> 22 #ifdef _KERNEL 23 # include <sys/systm.h> 24 #include <sys/pool.h> 25 #endif /* _KERNEL */ 26 #include <sys/mbuf.h> 27 #include <sys/syslog.h> 28 29 #include <netinet/in.h> 30 #include <netinet/ip.h> 31 #include <netinet/tcp.h> 32 33 #include <net/if.h> 34 #include <net/pfvar.h> 35 36 #include <netinet/ip6.h> 37 38 39 #ifdef _KERNEL 40 typedef struct pool pool_t; 41 42 #else 43 /* Userland equivalents so we can lend code to tcpdump et al. */ 44 45 # include <arpa/inet.h> 46 # include <errno.h> 47 # include <stdio.h> 48 # include <stdlib.h> 49 # include <string.h> 50 # include <netdb.h> 51 # define pool_t int 52 # define pool_get(pool, flags) malloc(*(pool)) 53 # define pool_put(pool, item) free(item) 54 # define pool_init(pool, size, a, ao, f, m, p) (*(pool)) = (size) 55 56 # ifdef PFDEBUG 57 # include <sys/stdarg.h> /* for DPFPRINTF() */ 58 # endif /* PFDEBUG */ 59 60 #endif /* _KERNEL */ 61 62 63 SLIST_HEAD(pf_osfp_list, pf_os_fingerprint) pf_osfp_list; 64 pool_t pf_osfp_entry_pl; 65 pool_t pf_osfp_pl; 66 67 struct pf_os_fingerprint *pf_osfp_find(struct pf_osfp_list *, 68 struct pf_os_fingerprint *, u_int8_t); 69 struct pf_os_fingerprint *pf_osfp_find_exact(struct pf_osfp_list *, 70 struct pf_os_fingerprint *); 71 void pf_osfp_insert(struct pf_osfp_list *, 72 struct pf_os_fingerprint *); 73 74 75 #ifdef _KERNEL 76 /* 77 * Passively fingerprint the OS of the host (IPv4 TCP SYN packets only) 78 * Returns the list of possible OSes. 79 */ 80 struct pf_osfp_enlist * 81 pf_osfp_fingerprint(struct pf_pdesc *pd) 82 { 83 struct tcphdr *th = pd->hdr.tcp; 84 struct ip *ip = NULL; 85 struct ip6_hdr *ip6 = NULL; 86 char hdr[60]; 87 88 if (pd->proto != IPPROTO_TCP) 89 return (NULL); 90 91 switch (pd->af) { 92 case AF_INET: 93 ip = mtod(pd->m, struct ip *); 94 break; 95 case AF_INET6: 96 ip6 = mtod(pd->m, struct ip6_hdr *); 97 break; 98 } 99 if (!pf_pull_hdr(pd->m, pd->off, hdr, th->th_off << 2, NULL, NULL, 100 pd->af)) 101 return (NULL); 102 103 return (pf_osfp_fingerprint_hdr(ip, ip6, (struct tcphdr *)hdr)); 104 } 105 #endif /* _KERNEL */ 106 107 struct pf_osfp_enlist * 108 pf_osfp_fingerprint_hdr(const struct ip *ip, const struct ip6_hdr *ip6, 109 const struct tcphdr *tcp) 110 { 111 struct pf_os_fingerprint fp, *fpresult; 112 int cnt, optlen = 0; 113 const u_int8_t *optp; 114 #ifdef _KERNEL 115 char srcname[128]; 116 #else 117 char srcname[NI_MAXHOST]; 118 #endif 119 120 if ((tcp->th_flags & (TH_SYN|TH_ACK)) != TH_SYN) 121 return (NULL); 122 if (ip) { 123 if ((ip->ip_off & htons(IP_OFFMASK)) != 0) 124 return (NULL); 125 } 126 127 memset(&fp, 0, sizeof(fp)); 128 129 if (ip) { 130 #ifndef _KERNEL 131 struct sockaddr_in sin; 132 #endif 133 134 fp.fp_psize = ntohs(ip->ip_len); 135 fp.fp_ttl = ip->ip_ttl; 136 if (ip->ip_off & htons(IP_DF)) 137 fp.fp_flags |= PF_OSFP_DF; 138 #ifdef _KERNEL 139 inet_ntop(AF_INET, &ip->ip_src, srcname, sizeof(srcname)); 140 #else 141 memset(&sin, 0, sizeof(sin)); 142 sin.sin_family = AF_INET; 143 sin.sin_len = sizeof(struct sockaddr_in); 144 sin.sin_addr = ip->ip_src; 145 (void)getnameinfo((struct sockaddr *)&sin, 146 sizeof(struct sockaddr_in), srcname, sizeof(srcname), 147 NULL, 0, NI_NUMERICHOST); 148 #endif 149 } 150 #ifdef INET6 151 else if (ip6) { 152 #ifndef _KERNEL 153 struct sockaddr_in6 sin6; 154 #endif 155 156 /* jumbo payload? */ 157 fp.fp_psize = sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen); 158 fp.fp_ttl = ip6->ip6_hlim; 159 fp.fp_flags |= PF_OSFP_DF; 160 fp.fp_flags |= PF_OSFP_INET6; 161 #ifdef _KERNEL 162 inet_ntop(AF_INET6, &ip6->ip6_src, srcname, sizeof(srcname)); 163 #else 164 memset(&sin6, 0, sizeof(sin6)); 165 sin6.sin6_family = AF_INET6; 166 sin6.sin6_len = sizeof(struct sockaddr_in6); 167 sin6.sin6_addr = ip6->ip6_src; 168 (void)getnameinfo((struct sockaddr *)&sin6, 169 sizeof(struct sockaddr_in6), srcname, sizeof(srcname), 170 NULL, 0, NI_NUMERICHOST); 171 #endif 172 } 173 #endif 174 else 175 return (NULL); 176 fp.fp_wsize = ntohs(tcp->th_win); 177 178 179 cnt = (tcp->th_off << 2) - sizeof(*tcp); 180 optp = (const u_int8_t *)((const char *)tcp + sizeof(*tcp)); 181 for (; cnt > 0; cnt -= optlen, optp += optlen) { 182 if (*optp == TCPOPT_EOL) 183 break; 184 185 fp.fp_optcnt++; 186 if (*optp == TCPOPT_NOP) { 187 fp.fp_tcpopts = (fp.fp_tcpopts << PF_OSFP_TCPOPT_BITS) | 188 PF_OSFP_TCPOPT_NOP; 189 optlen = 1; 190 } else { 191 if (cnt < 2) 192 return (NULL); 193 optlen = optp[1]; 194 if (optlen > cnt || optlen < 2) 195 return (NULL); 196 switch (*optp) { 197 case TCPOPT_MAXSEG: 198 if (optlen >= TCPOLEN_MAXSEG) 199 memcpy(&fp.fp_mss, &optp[2], 200 sizeof(fp.fp_mss)); 201 fp.fp_tcpopts = (fp.fp_tcpopts << 202 PF_OSFP_TCPOPT_BITS) | PF_OSFP_TCPOPT_MSS; 203 NTOHS(fp.fp_mss); 204 break; 205 case TCPOPT_WINDOW: 206 if (optlen >= TCPOLEN_WINDOW) 207 memcpy(&fp.fp_wscale, &optp[2], 208 sizeof(fp.fp_wscale)); 209 fp.fp_tcpopts = (fp.fp_tcpopts << 210 PF_OSFP_TCPOPT_BITS) | 211 PF_OSFP_TCPOPT_WSCALE; 212 break; 213 case TCPOPT_SACK_PERMITTED: 214 fp.fp_tcpopts = (fp.fp_tcpopts << 215 PF_OSFP_TCPOPT_BITS) | PF_OSFP_TCPOPT_SACK; 216 break; 217 case TCPOPT_TIMESTAMP: 218 if (optlen >= TCPOLEN_TIMESTAMP) { 219 u_int32_t ts; 220 memcpy(&ts, &optp[2], sizeof(ts)); 221 if (ts == 0) 222 fp.fp_flags |= PF_OSFP_TS0; 223 224 } 225 fp.fp_tcpopts = (fp.fp_tcpopts << 226 PF_OSFP_TCPOPT_BITS) | PF_OSFP_TCPOPT_TS; 227 break; 228 default: 229 return (NULL); 230 } 231 } 232 optlen = MAX(optlen, 1); /* paranoia */ 233 } 234 235 DPFPRINTF(LOG_NOTICE, 236 "fingerprinted %s:%d %d:%d:%d:%d:%llx (%d) " 237 "(TS=%s,M=%s%d,W=%s%d)", 238 srcname, ntohs(tcp->th_sport), 239 fp.fp_wsize, fp.fp_ttl, (fp.fp_flags & PF_OSFP_DF) != 0, 240 fp.fp_psize, (long long int)fp.fp_tcpopts, fp.fp_optcnt, 241 (fp.fp_flags & PF_OSFP_TS0) ? "0" : "", 242 (fp.fp_flags & PF_OSFP_MSS_MOD) ? "%" : 243 (fp.fp_flags & PF_OSFP_MSS_DC) ? "*" : "", 244 fp.fp_mss, 245 (fp.fp_flags & PF_OSFP_WSCALE_MOD) ? "%" : 246 (fp.fp_flags & PF_OSFP_WSCALE_DC) ? "*" : "", 247 fp.fp_wscale); 248 249 if ((fpresult = pf_osfp_find(&pf_osfp_list, &fp, 250 PF_OSFP_MAXTTL_OFFSET))) 251 return (&fpresult->fp_oses); 252 return (NULL); 253 } 254 255 /* Match a fingerprint ID against a list of OSes */ 256 int 257 pf_osfp_match(struct pf_osfp_enlist *list, pf_osfp_t os) 258 { 259 struct pf_osfp_entry *entry; 260 int os_class, os_version, os_subtype; 261 int en_class, en_version, en_subtype; 262 263 if (os == PF_OSFP_ANY) 264 return (1); 265 if (list == NULL) { 266 DPFPRINTF(LOG_NOTICE, "osfp no match against %x", os); 267 return (os == PF_OSFP_UNKNOWN); 268 } 269 PF_OSFP_UNPACK(os, os_class, os_version, os_subtype); 270 SLIST_FOREACH(entry, list, fp_entry) { 271 PF_OSFP_UNPACK(entry->fp_os, en_class, en_version, en_subtype); 272 if ((os_class == PF_OSFP_ANY || en_class == os_class) && 273 (os_version == PF_OSFP_ANY || en_version == os_version) && 274 (os_subtype == PF_OSFP_ANY || en_subtype == os_subtype)) { 275 DPFPRINTF(LOG_NOTICE, 276 "osfp matched %s %s %s %x==%x", 277 entry->fp_class_nm, entry->fp_version_nm, 278 entry->fp_subtype_nm, os, entry->fp_os); 279 return (1); 280 } 281 } 282 DPFPRINTF(LOG_NOTICE, "fingerprint 0x%x didn't match", os); 283 return (0); 284 } 285 286 /* Initialize the OS fingerprint system */ 287 void 288 pf_osfp_initialize(void) 289 { 290 pool_init(&pf_osfp_entry_pl, sizeof(struct pf_osfp_entry), 0, 0, 0, 291 "pfosfpen", &pool_allocator_nointr); 292 pool_init(&pf_osfp_pl, sizeof(struct pf_os_fingerprint), 0, 0, 0, 293 "pfosfp", &pool_allocator_nointr); 294 SLIST_INIT(&pf_osfp_list); 295 } 296 297 /* Flush the fingerprint list */ 298 void 299 pf_osfp_flush(void) 300 { 301 struct pf_os_fingerprint *fp; 302 struct pf_osfp_entry *entry; 303 304 while ((fp = SLIST_FIRST(&pf_osfp_list))) { 305 SLIST_REMOVE_HEAD(&pf_osfp_list, fp_next); 306 while ((entry = SLIST_FIRST(&fp->fp_oses))) { 307 SLIST_REMOVE_HEAD(&fp->fp_oses, fp_entry); 308 pool_put(&pf_osfp_entry_pl, entry); 309 } 310 pool_put(&pf_osfp_pl, fp); 311 } 312 } 313 314 315 /* Add a fingerprint */ 316 int 317 pf_osfp_add(struct pf_osfp_ioctl *fpioc) 318 { 319 struct pf_os_fingerprint *fp, fpadd; 320 struct pf_osfp_entry *entry; 321 322 memset(&fpadd, 0, sizeof(fpadd)); 323 fpadd.fp_tcpopts = fpioc->fp_tcpopts; 324 fpadd.fp_wsize = fpioc->fp_wsize; 325 fpadd.fp_psize = fpioc->fp_psize; 326 fpadd.fp_mss = fpioc->fp_mss; 327 fpadd.fp_flags = fpioc->fp_flags; 328 fpadd.fp_optcnt = fpioc->fp_optcnt; 329 fpadd.fp_wscale = fpioc->fp_wscale; 330 fpadd.fp_ttl = fpioc->fp_ttl; 331 332 DPFPRINTF(LOG_DEBUG, 333 "adding osfp %s %s %s = %s%d:%d:%d:%s%d:0x%llx %d " 334 "(TS=%s,M=%s%d,W=%s%d) %x", 335 fpioc->fp_os.fp_class_nm, fpioc->fp_os.fp_version_nm, 336 fpioc->fp_os.fp_subtype_nm, 337 (fpadd.fp_flags & PF_OSFP_WSIZE_MOD) ? "%" : 338 (fpadd.fp_flags & PF_OSFP_WSIZE_MSS) ? "S" : 339 (fpadd.fp_flags & PF_OSFP_WSIZE_MTU) ? "T" : 340 (fpadd.fp_flags & PF_OSFP_WSIZE_DC) ? "*" : "", 341 fpadd.fp_wsize, 342 fpadd.fp_ttl, 343 (fpadd.fp_flags & PF_OSFP_DF) ? 1 : 0, 344 (fpadd.fp_flags & PF_OSFP_PSIZE_MOD) ? "%" : 345 (fpadd.fp_flags & PF_OSFP_PSIZE_DC) ? "*" : "", 346 fpadd.fp_psize, 347 (long long int)fpadd.fp_tcpopts, fpadd.fp_optcnt, 348 (fpadd.fp_flags & PF_OSFP_TS0) ? "0" : "", 349 (fpadd.fp_flags & PF_OSFP_MSS_MOD) ? "%" : 350 (fpadd.fp_flags & PF_OSFP_MSS_DC) ? "*" : "", 351 fpadd.fp_mss, 352 (fpadd.fp_flags & PF_OSFP_WSCALE_MOD) ? "%" : 353 (fpadd.fp_flags & PF_OSFP_WSCALE_DC) ? "*" : "", 354 fpadd.fp_wscale, 355 fpioc->fp_os.fp_os); 356 357 if ((fp = pf_osfp_find_exact(&pf_osfp_list, &fpadd))) { 358 SLIST_FOREACH(entry, &fp->fp_oses, fp_entry) { 359 if (PF_OSFP_ENTRY_EQ(entry, &fpioc->fp_os)) 360 return (EEXIST); 361 } 362 if ((entry = pool_get(&pf_osfp_entry_pl, 363 PR_WAITOK|PR_LIMITFAIL)) == NULL) 364 return (ENOMEM); 365 } else { 366 if ((fp = pool_get(&pf_osfp_pl, 367 PR_WAITOK|PR_ZERO|PR_LIMITFAIL)) == NULL) 368 return (ENOMEM); 369 fp->fp_tcpopts = fpioc->fp_tcpopts; 370 fp->fp_wsize = fpioc->fp_wsize; 371 fp->fp_psize = fpioc->fp_psize; 372 fp->fp_mss = fpioc->fp_mss; 373 fp->fp_flags = fpioc->fp_flags; 374 fp->fp_optcnt = fpioc->fp_optcnt; 375 fp->fp_wscale = fpioc->fp_wscale; 376 fp->fp_ttl = fpioc->fp_ttl; 377 SLIST_INIT(&fp->fp_oses); 378 if ((entry = pool_get(&pf_osfp_entry_pl, 379 PR_WAITOK|PR_LIMITFAIL)) == NULL) { 380 pool_put(&pf_osfp_pl, fp); 381 return (ENOMEM); 382 } 383 pf_osfp_insert(&pf_osfp_list, fp); 384 } 385 memcpy(entry, &fpioc->fp_os, sizeof(*entry)); 386 387 /* Make sure the strings are NUL terminated */ 388 entry->fp_class_nm[sizeof(entry->fp_class_nm)-1] = '\0'; 389 entry->fp_version_nm[sizeof(entry->fp_version_nm)-1] = '\0'; 390 entry->fp_subtype_nm[sizeof(entry->fp_subtype_nm)-1] = '\0'; 391 392 SLIST_INSERT_HEAD(&fp->fp_oses, entry, fp_entry); 393 394 #ifdef PFDEBUG 395 if ((fp = pf_osfp_validate())) 396 DPFPRINTF(LOG_NOTICE, 397 "Invalid fingerprint list"); 398 #endif /* PFDEBUG */ 399 return (0); 400 } 401 402 403 /* Find a fingerprint in the list */ 404 struct pf_os_fingerprint * 405 pf_osfp_find(struct pf_osfp_list *list, struct pf_os_fingerprint *find, 406 u_int8_t ttldiff) 407 { 408 struct pf_os_fingerprint *f; 409 410 #define MATCH_INT(_MOD, _DC, _field) \ 411 if ((f->fp_flags & _DC) == 0) { \ 412 if ((f->fp_flags & _MOD) == 0) { \ 413 if (f->_field != find->_field) \ 414 continue; \ 415 } else { \ 416 if (f->_field == 0 || find->_field % f->_field) \ 417 continue; \ 418 } \ 419 } 420 421 SLIST_FOREACH(f, list, fp_next) { 422 if (f->fp_tcpopts != find->fp_tcpopts || 423 f->fp_optcnt != find->fp_optcnt || 424 f->fp_ttl < find->fp_ttl || 425 f->fp_ttl - find->fp_ttl > ttldiff || 426 (f->fp_flags & (PF_OSFP_DF|PF_OSFP_TS0)) != 427 (find->fp_flags & (PF_OSFP_DF|PF_OSFP_TS0))) 428 continue; 429 430 MATCH_INT(PF_OSFP_PSIZE_MOD, PF_OSFP_PSIZE_DC, fp_psize) 431 MATCH_INT(PF_OSFP_MSS_MOD, PF_OSFP_MSS_DC, fp_mss) 432 MATCH_INT(PF_OSFP_WSCALE_MOD, PF_OSFP_WSCALE_DC, fp_wscale) 433 if ((f->fp_flags & PF_OSFP_WSIZE_DC) == 0) { 434 if (f->fp_flags & PF_OSFP_WSIZE_MSS) { 435 if (find->fp_mss == 0) 436 continue; 437 438 /* Some "smart" NAT devices and DSL routers will tweak the MSS size and 439 * will set it to whatever is suitable for the link type. 440 */ 441 #define SMART_MSS 1460 442 if ((find->fp_wsize % find->fp_mss || 443 find->fp_wsize / find->fp_mss != 444 f->fp_wsize) && 445 (find->fp_wsize % SMART_MSS || 446 find->fp_wsize / SMART_MSS != 447 f->fp_wsize)) 448 continue; 449 } else if (f->fp_flags & PF_OSFP_WSIZE_MTU) { 450 if (find->fp_mss == 0) 451 continue; 452 453 #define MTUOFF (sizeof(struct ip) + sizeof(struct tcphdr)) 454 #define SMART_MTU (SMART_MSS + MTUOFF) 455 if ((find->fp_wsize % (find->fp_mss + MTUOFF) || 456 find->fp_wsize / (find->fp_mss + MTUOFF) != 457 f->fp_wsize) && 458 (find->fp_wsize % SMART_MTU || 459 find->fp_wsize / SMART_MTU != 460 f->fp_wsize)) 461 continue; 462 } else if (f->fp_flags & PF_OSFP_WSIZE_MOD) { 463 if (f->fp_wsize == 0 || find->fp_wsize % 464 f->fp_wsize) 465 continue; 466 } else { 467 if (f->fp_wsize != find->fp_wsize) 468 continue; 469 } 470 } 471 return (f); 472 } 473 474 return (NULL); 475 } 476 477 /* Find an exact fingerprint in the list */ 478 struct pf_os_fingerprint * 479 pf_osfp_find_exact(struct pf_osfp_list *list, struct pf_os_fingerprint *find) 480 { 481 struct pf_os_fingerprint *f; 482 483 SLIST_FOREACH(f, list, fp_next) { 484 if (f->fp_tcpopts == find->fp_tcpopts && 485 f->fp_wsize == find->fp_wsize && 486 f->fp_psize == find->fp_psize && 487 f->fp_mss == find->fp_mss && 488 f->fp_flags == find->fp_flags && 489 f->fp_optcnt == find->fp_optcnt && 490 f->fp_wscale == find->fp_wscale && 491 f->fp_ttl == find->fp_ttl) 492 return (f); 493 } 494 495 return (NULL); 496 } 497 498 /* Insert a fingerprint into the list */ 499 void 500 pf_osfp_insert(struct pf_osfp_list *list, struct pf_os_fingerprint *ins) 501 { 502 struct pf_os_fingerprint *f, *prev = NULL; 503 504 /* XXX need to go semi tree based. can key on tcp options */ 505 506 SLIST_FOREACH(f, list, fp_next) 507 prev = f; 508 if (prev) 509 SLIST_INSERT_AFTER(prev, ins, fp_next); 510 else 511 SLIST_INSERT_HEAD(list, ins, fp_next); 512 } 513 514 /* Fill a fingerprint by its number (from an ioctl) */ 515 int 516 pf_osfp_get(struct pf_osfp_ioctl *fpioc) 517 { 518 struct pf_os_fingerprint *fp; 519 struct pf_osfp_entry *entry; 520 int num = fpioc->fp_getnum; 521 int i = 0; 522 523 524 memset(fpioc, 0, sizeof(*fpioc)); 525 SLIST_FOREACH(fp, &pf_osfp_list, fp_next) { 526 SLIST_FOREACH(entry, &fp->fp_oses, fp_entry) { 527 if (i++ == num) { 528 fpioc->fp_mss = fp->fp_mss; 529 fpioc->fp_wsize = fp->fp_wsize; 530 fpioc->fp_flags = fp->fp_flags; 531 fpioc->fp_psize = fp->fp_psize; 532 fpioc->fp_ttl = fp->fp_ttl; 533 fpioc->fp_wscale = fp->fp_wscale; 534 fpioc->fp_getnum = num; 535 memcpy(&fpioc->fp_os, entry, 536 sizeof(fpioc->fp_os)); 537 return (0); 538 } 539 } 540 } 541 542 return (EBUSY); 543 } 544 545 546 /* Validate that each signature is reachable */ 547 struct pf_os_fingerprint * 548 pf_osfp_validate(void) 549 { 550 struct pf_os_fingerprint *f, *f2, find; 551 552 SLIST_FOREACH(f, &pf_osfp_list, fp_next) { 553 memcpy(&find, f, sizeof(find)); 554 555 /* We do a few MSS/th_win percolations to make things unique */ 556 if (find.fp_mss == 0) 557 find.fp_mss = 128; 558 if (f->fp_flags & PF_OSFP_WSIZE_MSS) 559 find.fp_wsize *= find.fp_mss; 560 else if (f->fp_flags & PF_OSFP_WSIZE_MTU) 561 find.fp_wsize *= (find.fp_mss + 40); 562 else if (f->fp_flags & PF_OSFP_WSIZE_MOD) 563 find.fp_wsize *= 2; 564 if (f != (f2 = pf_osfp_find(&pf_osfp_list, &find, 0))) { 565 if (f2) 566 DPFPRINTF(LOG_NOTICE, 567 "Found \"%s %s %s\" instead of " 568 "\"%s %s %s\"\n", 569 SLIST_FIRST(&f2->fp_oses)->fp_class_nm, 570 SLIST_FIRST(&f2->fp_oses)->fp_version_nm, 571 SLIST_FIRST(&f2->fp_oses)->fp_subtype_nm, 572 SLIST_FIRST(&f->fp_oses)->fp_class_nm, 573 SLIST_FIRST(&f->fp_oses)->fp_version_nm, 574 SLIST_FIRST(&f->fp_oses)->fp_subtype_nm); 575 else 576 DPFPRINTF(LOG_NOTICE, 577 "Couldn't find \"%s %s %s\"\n", 578 SLIST_FIRST(&f->fp_oses)->fp_class_nm, 579 SLIST_FIRST(&f->fp_oses)->fp_version_nm, 580 SLIST_FIRST(&f->fp_oses)->fp_subtype_nm); 581 return (f); 582 } 583 } 584 return (NULL); 585 } 586