Source-Changes-HG archive

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

[src/trunk]: src/sys/net Count length from the beginning of the structure not...



details:   https://anonhg.NetBSD.org/src/rev/74e8dc08bea1
branches:  trunk
changeset: 773313:74e8dc08bea1
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jan 30 20:01:08 2012 +0000

description:
Count length from the beginning of the structure not the sa_data portion.
>From skrll@

diffstat:

 sys/net/route.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r a0d6acd9f7c2 -r 74e8dc08bea1 sys/net/route.c
--- a/sys/net/route.c   Mon Jan 30 19:41:18 2012 +0000
+++ b/sys/net/route.c   Mon Jan 30 20:01:08 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: route.c,v 1.125 2011/03/31 19:40:52 dyoung Exp $       */
+/*     $NetBSD: route.c,v 1.126 2012/01/30 20:01:08 christos Exp $     */
 
 /*-
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -93,7 +93,7 @@
 #include "opt_route.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.125 2011/03/31 19:40:52 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.126 2012/01/30 20:01:08 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/kmem.h>
@@ -909,8 +909,8 @@
        const char *netmaskp = &netmask->sa_data[0],
                   *srcp = &src->sa_data[0];
        char *dstp = &dst->sa_data[0];
-       const char *maskend = dstp + MIN(netmask->sa_len, src->sa_len);
-       const char *srcend = dstp + src->sa_len;
+       const char *maskend = (char *)dst + MIN(netmask->sa_len, src->sa_len);
+       const char *srcend = (char *)dst + src->sa_len;
 
        dst->sa_len = src->sa_len;
        dst->sa_family = src->sa_family;



Home | Main Index | Thread Index | Old Index