[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140319133955.6458fe5a@nehalam.linuxnetplumber.net>
Date: Wed, 19 Mar 2014 13:39:55 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Nicolas Dichtel <nicolas.dichtel@...nd.com>
Cc: shemminger@...tta.com, netdev@...r.kernel.org
Subject: Re: [PATCH v2 iproute2 -next 2/2] ipxfrm: allow to setup filter
when dumping SA
On Wed, 19 Mar 2014 17:52:08 +0100
Nicolas Dichtel <nicolas.dichtel@...nd.com> wrote:
> diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c
> index 140a4503b799..8295223f8118 100644
> --- a/ip/xfrm_state.c
> +++ b/ip/xfrm_state.c
> @@ -1136,7 +1136,35 @@ static int xfrm_state_list_or_deleteall(int argc, char **argv, int deleteall)
> }
>
> } else {
> - if (rtnl_wilddump_request(&rth, preferred_family, XFRM_MSG_GETSA) < 0) {
> + struct xfrm_address_filter addrfilter;
> + struct {
> + struct nlmsghdr n;
> + char buf[NLMSG_BUF_SIZE];
> + } req;
> +
> + memset(&addrfilter, 0, sizeof(addrfilter));
> + addrfilter.family = filter.xsinfo.family;
> + memcpy(&addrfilter.saddr, &filter.xsinfo.saddr,
> + sizeof(xfrm_address_t));
> + addrfilter.splen = filter.id_src_mask;
> + memcpy(&addrfilter.daddr, &filter.xsinfo.id.daddr,
> + sizeof(xfrm_address_t));
> + addrfilter.dplen = filter.id_dst_mask;
> +
I prefer to see C99 initializers for stack variables when possible
instead of using memset().
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists