Module Name: src Committed By: christos Date: Sat Oct 19 00:57:41 UTC 2013
Modified Files: src/sbin/routed/rtquery: rtquery.c Log Message: gcc warns about array bounds limits, but unfortunately the API here requires flex arrays in a union which is not allowed. So do a trivial pointer assignment to baffle gcc again. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sbin/routed/rtquery/rtquery.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sbin/routed/rtquery/rtquery.c diff -u src/sbin/routed/rtquery/rtquery.c:1.23 src/sbin/routed/rtquery/rtquery.c:1.24 --- src/sbin/routed/rtquery/rtquery.c:1.23 Mon Aug 29 10:35:04 2011 +++ src/sbin/routed/rtquery/rtquery.c Fri Oct 18 20:57:41 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rtquery.c,v 1.23 2011/08/29 14:35:04 joerg Exp $ */ +/* $NetBSD: rtquery.c,v 1.24 2013/10/19 00:57:41 christos Exp $ */ /*- * Copyright (c) 1982, 1986, 1993 @@ -63,7 +63,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1988, 1993\ The Regents of the University of California. All rights reserved."); #ifdef __NetBSD__ -__RCSID("$NetBSD: rtquery.c,v 1.23 2011/08/29 14:35:04 joerg Exp $"); +__RCSID("$NetBSD: rtquery.c,v 1.24 2013/10/19 00:57:41 christos Exp $"); #elif defined(__FreeBSD__) __RCSID("$FreeBSD$"); #else @@ -372,8 +372,9 @@ trace_loop(char *argv[]) static void query_loop(char *argv[], int argc) { -# define NA0 (OMSG.rip_auths[0]) -# define NA2 (OMSG.rip_auths[2]) + struct netauth *na = OMSG.rip_auths; +# define NA0 (na[0]) +# define NA2 (na[2]) struct seen { struct seen *next; struct in_addr addr; @@ -391,14 +392,14 @@ query_loop(char *argv[], int argc) if (ripv2) { OMSG.rip_vers = RIPv2; if (auth_type == RIP_AUTH_PW) { - OMSG.rip_nets[1] = OMSG.rip_nets[0]; + na[1] = na[0]; NA0.a_family = RIP_AF_AUTH; NA0.a_type = RIP_AUTH_PW; memcpy(NA0.au.au_pw, passwd, RIP_AUTH_PW_LEN); omsg_len += sizeof(OMSG.rip_nets[0]); } else if (auth_type == RIP_AUTH_MD5) { - OMSG.rip_nets[1] = OMSG.rip_nets[0]; + na[1] = na[0]; NA0.a_family = RIP_AF_AUTH; NA0.a_type = RIP_AUTH_MD5; NA0.au.a_md5.md5_keyid = (int8_t)keyid;