Module Name: src Committed By: rmind Date: Mon Sep 10 21:42:53 UTC 2012
Modified Files: src/sys/net/npf: npf_alg_icmp.c Log Message: npf_icmp_uniqid: inspect the correct npc_info for IPv4/v6. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/net/npf/npf_alg_icmp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/net/npf/npf_alg_icmp.c diff -u src/sys/net/npf/npf_alg_icmp.c:1.11 src/sys/net/npf/npf_alg_icmp.c:1.12 --- src/sys/net/npf/npf_alg_icmp.c:1.11 Thu Jul 19 21:52:29 2012 +++ src/sys/net/npf/npf_alg_icmp.c Mon Sep 10 21:42:53 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: npf_alg_icmp.c,v 1.11 2012/07/19 21:52:29 spz Exp $ */ +/* $NetBSD: npf_alg_icmp.c,v 1.12 2012/09/10 21:42:53 rmind Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: npf_alg_icmp.c,v 1.11 2012/07/19 21:52:29 spz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: npf_alg_icmp.c,v 1.12 2012/09/10 21:42:53 rmind Exp $"); #include <sys/param.h> #include <sys/module.h> @@ -155,13 +155,14 @@ npfa_icmp_match(npf_cache_t *npc, nbuf_t * or TCP/UDP ports of the original packet, which is embedded. */ static bool -npf_icmp_uniqid(const int type, npf_cache_t *npc, nbuf_t *nbuf, void *n_ptr) +npf_icmp_uniqid(const int npcinf, const int type, + npf_cache_t *npc, nbuf_t *nbuf, void *n_ptr) { struct icmp *ic; struct icmp6_hdr *ic6; u_int offby; - if (npf_iscached(npc, NPC_IP4)) { + if (npcinf & NPC_IP4) { /* Per RFC 792. */ switch (type) { case ICMP_UNREACH: @@ -209,7 +210,7 @@ npf_icmp_uniqid(const int type, npf_cach /* No unique IDs. */ return false; } - if (npf_iscached(npc, NPC_IP6)) { + if (npcinf & NPC_IP6) { switch (type) { /* Per RFC 4443. */ case ICMP6_DST_UNREACH: @@ -307,7 +308,8 @@ npfa_icmp_session(npf_cache_t *npc, nbuf /* Fetch relevant data into the separate ("key") cache. */ struct icmp *ic = &npc->npc_l4.icmp; - if (!npf_icmp_uniqid(ic->icmp_type, key, nbuf, n_ptr)) { + if (!npf_icmp_uniqid(npc->npc_info & NPC_IP46, ic->icmp_type, + key, nbuf, n_ptr)) { return false; }