From 52ebde656f17605a0c860eaa9e8c44618d85fa45 Mon Sep 17 00:00:00 2001 From: christos Date: Sat, 19 Oct 2013 00:57:41 +0000 Subject: [PATCH] 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. --- sbin/routed/rtquery/rtquery.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sbin/routed/rtquery/rtquery.c b/sbin/routed/rtquery/rtquery.c index d3a6a9cbc9a8..8285e6feff25 100644 --- a/sbin/routed/rtquery/rtquery.c +++ b/sbin/routed/rtquery/rtquery.c @@ -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;