Module Name: src
Committed By: riz
Date: Thu Sep 13 22:33:05 UTC 2012
Modified Files:
src/sys/net/npf [netbsd-6]: npf_alg_icmp.c
Log Message:
Pull up following revision(s) (requested by rmind in ticket #555):
sys/net/npf/npf_alg_icmp.c: revision 1.12
npf_icmp_uniqid: inspect the correct npc_info for IPv4/v6.
To generate a diff of this commit:
cvs rdiff -u -r1.8.4.3 -r1.8.4.4 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.8.4.3 src/sys/net/npf/npf_alg_icmp.c:1.8.4.4
--- src/sys/net/npf/npf_alg_icmp.c:1.8.4.3 Wed Jul 25 20:45:23 2012
+++ src/sys/net/npf/npf_alg_icmp.c Thu Sep 13 22:33:05 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: npf_alg_icmp.c,v 1.8.4.3 2012/07/25 20:45:23 jdc Exp $ */
+/* $NetBSD: npf_alg_icmp.c,v 1.8.4.4 2012/09/13 22:33:05 riz 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.8.4.3 2012/07/25 20:45:23 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_alg_icmp.c,v 1.8.4.4 2012/09/13 22:33:05 riz 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;
}