Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net/npf npf_icmp_uniqid: inspect the correct npc_info fo...



details:   https://anonhg.NetBSD.org/src/rev/1363f041cef5
branches:  trunk
changeset: 781498:1363f041cef5
user:      rmind <rmind%NetBSD.org@localhost>
date:      Mon Sep 10 21:42:53 2012 +0000

description:
npf_icmp_uniqid: inspect the correct npc_info for IPv4/v6.

diffstat:

 sys/net/npf/npf_alg_icmp.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r 2cef5cebe897 -r 1363f041cef5 sys/net/npf/npf_alg_icmp.c
--- a/sys/net/npf/npf_alg_icmp.c        Mon Sep 10 20:53:18 2012 +0000
+++ b/sys/net/npf/npf_alg_icmp.c        Mon Sep 10 21:42:53 2012 +0000
@@ -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 @@
  * 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 @@
                /* 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 @@
 
        /* 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;
        }
 



Home | Main Index | Thread Index | Old Index