Source-Changes-HG archive

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

[src/netbsd-6]: src Pull up following revision(s) (requested by rmind in tick...



details:   https://anonhg.NetBSD.org/src/rev/b731566ca169
branches:  netbsd-6
changeset: 774472:b731566ca169
user:      riz <riz%NetBSD.org@localhost>
date:      Sun Aug 19 17:40:31 2012 +0000

description:
Pull up following revision(s) (requested by rmind in ticket #511):
        lib/libnpf/npf.c: revision 1.12
        sys/net/npf/npf_ctl.c: revision 1.17
        sys/net/npf/npf_nat.c: revision 1.17
- {npf_mk_rproc,npf_nat_save}: fix the fetching of {rproc-ptr,id_ptr}.
- npf_rproc_setlog: initialise variables to 0, as keys may not exist.
Bugs found by mlelstv@ while testing on Amiga.

diffstat:

 lib/libnpf/npf.c      |   8 ++++----
 sys/net/npf/npf_ctl.c |  13 ++++++++-----
 sys/net/npf/npf_nat.c |  10 +++++-----
 3 files changed, 17 insertions(+), 14 deletions(-)

diffs (116 lines):

diff -r e78448b50f97 -r b731566ca169 lib/libnpf/npf.c
--- a/lib/libnpf/npf.c  Sun Aug 19 17:36:41 2012 +0000
+++ b/lib/libnpf/npf.c  Sun Aug 19 17:40:31 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: npf.c,v 1.7.2.4 2012/08/13 17:49:51 riz Exp $  */
+/*     $NetBSD: npf.c,v 1.7.2.5 2012/08/19 17:40:31 riz Exp $  */
 
 /*-
  * Copyright (c) 2010-2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.7.2.4 2012/08/13 17:49:51 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.7.2.5 2012/08/19 17:40:31 riz Exp $");
 
 #include <sys/types.h>
 #include <netinet/in_systm.h>
@@ -456,7 +456,7 @@
     u_int maxmss)
 {
        prop_dictionary_t rpdict = rp->nrp_dict;
-       uint32_t fl;
+       uint32_t fl = 0;
 
        prop_dictionary_set_bool(rpdict, "randomize-id", rnd);
        prop_dictionary_set_bool(rpdict, "no-df", no_df);
@@ -472,7 +472,7 @@
 _npf_rproc_setlog(nl_rproc_t *rp, u_int if_idx)
 {
        prop_dictionary_t rpdict = rp->nrp_dict;
-       uint32_t fl;
+       uint32_t fl = 0;
 
        prop_dictionary_set_uint32(rpdict, "log-interface", if_idx);
 
diff -r e78448b50f97 -r b731566ca169 sys/net/npf/npf_ctl.c
--- a/sys/net/npf/npf_ctl.c     Sun Aug 19 17:36:41 2012 +0000
+++ b/sys/net/npf/npf_ctl.c     Sun Aug 19 17:40:31 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: npf_ctl.c,v 1.12.2.3 2012/07/16 22:13:26 riz Exp $     */
+/*     $NetBSD: npf_ctl.c,v 1.12.2.4 2012/08/19 17:40:31 riz Exp $     */
 
 /*-
  * Copyright (c) 2009-2012 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: npf_ctl.c,v 1.12.2.3 2012/07/16 22:13:26 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_ctl.c,v 1.12.2.4 2012/08/19 17:40:31 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -164,6 +164,7 @@
        prop_object_iterator_t it;
        prop_dictionary_t rpdict;
        npf_rproc_t *rp;
+       uint64_t rpval;
 
        it = prop_array_iterator(rprocs);
        while ((rpdict = prop_object_iterator_next(it)) != NULL) {
@@ -178,10 +179,12 @@
                return NULL;
        }
        CTASSERT(sizeof(uintptr_t) <= sizeof(uint64_t));
-       if (!prop_dictionary_get_uint64(rpdict, "rproc-ptr", (uint64_t *)&rp)) {
+       if (!prop_dictionary_get_uint64(rpdict, "rproc-ptr", &rpval)) {
                rp = npf_rproc_create(rpdict);
-               prop_dictionary_set_uint64(rpdict, "rproc-ptr",
-                   (uint64_t)(uintptr_t)rp);
+               rpval = (uint64_t)(uintptr_t)rp;
+               prop_dictionary_set_uint64(rpdict, "rproc-ptr", rpval);
+       } else {
+               rp = (npf_rproc_t *)(uintptr_t)rpval;
        }
        return rp;
 }
diff -r e78448b50f97 -r b731566ca169 sys/net/npf/npf_nat.c
--- a/sys/net/npf/npf_nat.c     Sun Aug 19 17:36:41 2012 +0000
+++ b/sys/net/npf/npf_nat.c     Sun Aug 19 17:40:31 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: npf_nat.c,v 1.10.2.5 2012/08/13 17:49:52 riz Exp $     */
+/*     $NetBSD: npf_nat.c,v 1.10.2.6 2012/08/19 17:40:31 riz Exp $     */
 
 /*-
  * Copyright (c) 2010-2012 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: npf_nat.c,v 1.10.2.5 2012/08/13 17:49:52 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_nat.c,v 1.10.2.6 2012/08/19 17:40:31 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -751,7 +751,7 @@
        prop_object_iterator_t it;
        prop_dictionary_t npdict;
        prop_data_t nd, npd;
-       uintptr_t itnp;
+       uint64_t itnp;
 
        /* Set NAT entry data. */
        nd = prop_data_create_data(nt, sizeof(npf_nat_t));
@@ -762,8 +762,8 @@
        it = prop_array_iterator(natlist);
        while ((npdict = prop_object_iterator_next(it)) != NULL) {
                CTASSERT(sizeof(uintptr_t) <= sizeof(uint64_t));
-               prop_dictionary_get_uint64(npdict, "id-ptr", (uint64_t *)&itnp);
-               if (itnp == (uintptr_t)np) {
+               prop_dictionary_get_uint64(npdict, "id-ptr", &itnp);
+               if ((uintptr_t)itnp == (uintptr_t)np) {
                        break;
                }
        }



Home | Main Index | Thread Index | Old Index