Source-Changes archive

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

Re: CVS commit: src/sys/netinet



On Thu, Apr 01, 2004 at 09:24:58AM +0000, Martin Husemann wrote:
> 
> Module Name:  src
> Committed By: martin
> Date:         Thu Apr  1 09:24:58 UTC 2004
> 
> Modified Files:
>       src/sys/netinet: ip_fil_netbsd.c
> 
> Log Message:
> Untangle ioctl copyin/copyout confusion. IP-Filter now actually works
> on sparc64 (and probably everywhere else).

If I'm following this correctly, I think the following other changes are 
also needed to maintain the pattern that we BCOPYIN the ioctl structure
itself, then COPYIN from pointers in it.

Someone please verify this and commit it. I don't have a machine to test 
on yet.

Take care,

Bill
Index: fil.c
===================================================================
RCS file: /cvsroot/src/sys/netinet/fil.c,v
retrieving revision 1.61
diff -u -r1.61 fil.c
--- fil.c       28 Mar 2004 09:01:26 -0000      1.61
+++ fil.c       1 Apr 2004 17:18:35 -0000
@@ -4360,7 +4360,7 @@
 {
        ipfunc_resolve_t res, *ft;
 
-       if (COPYIN(data, &res, sizeof(res)) != 0)
+       if (BCOPYIN(data, &res, sizeof(res)) != 0)
                return EFAULT;
 
        if (res.ipfu_addr == NULL && res.ipfu_name[0] != '\0') {
Index: ip_lookup.c
===================================================================
RCS file: /cvsroot/src/sys/netinet/ip_lookup.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 ip_lookup.c
--- ip_lookup.c 28 Mar 2004 08:56:44 -0000      1.1.1.1
+++ ip_lookup.c 1 Apr 2004 17:18:35 -0000
@@ -214,7 +214,7 @@
        ip_pool_t *p;
        int err;
 
-       err = COPYIN(data, &op, sizeof(op));
+       err = BCOPYIN(data, &op, sizeof(op));
        if (err != 0)
                return EFAULT;
        op.iplo_name[sizeof(op.iplo_name) - 1] = '\0';
@@ -285,7 +285,7 @@
        ip_pool_t *p;
        int err;
 
-       err = COPYIN(data, &op, sizeof(op));
+       err = BCOPYIN(data, &op, sizeof(op));
        if (err != 0)
                return EFAULT;
        op.iplo_name[sizeof(op.iplo_name) - 1] = '\0';
@@ -346,7 +346,7 @@
        iplookupop_t op;
        int err;
 
-       err = COPYIN(data, &op, sizeof(op));
+       err = BCOPYIN(data, &op, sizeof(op));
        if (err != 0)
                return EFAULT;
        op.iplo_name[sizeof(op.iplo_name) - 1] = '\0';
@@ -389,7 +389,7 @@
        iplookupop_t op;
        int err;
 
-       err = COPYIN(data, &op, sizeof(op));
+       err = BCOPYIN(data, &op, sizeof(op));
        if (err != 0)
                return EFAULT;
        op.iplo_name[sizeof(op.iplo_name) - 1] = '\0';
@@ -432,7 +432,7 @@
        iplookupop_t op;
        int err;
 
-       err = COPYIN(data, &op, sizeof(op));
+       err = BCOPYIN(data, &op, sizeof(op));
        if (err != 0)
                return EFAULT;
 
@@ -468,7 +468,7 @@
        int err, unit, num, type;
        iplookupflush_t flush;
 
-       err = COPYIN(data, &flush, sizeof(flush));
+       err = BCOPYIN(data, &flush, sizeof(flush));
        if (err != 0)
                return EFAULT;
 

Attachment: pgpbCUdXOepXd.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index