From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft 2/2] src: restore interface to index cache
Date: Mon, 6 Apr 2015 14:58:57 +0200 [thread overview]
Message-ID: <20150406125857.GA13992@salvia> (raw)
In-Reply-To: <3C9F7A57-9442-4E37-952D-38A071E71B14@trash.net>
On Mon, Apr 06, 2015 at 02:39:26PM +0200, Patrick McHardy wrote:
> Am 6. April 2015 14:06:31 MESZ, schrieb Pablo Neira Ayuso <pablo@netfilter.org>:
[...]
> >+static int data_cb(const struct nlmsghdr *nlh, void *data)
> >+{
> >+ struct nlattr *tb[IFLA_MAX + 1] = {};
> >+ struct ifinfomsg *ifm = mnl_nlmsg_get_payload(nlh);
> >+ struct iface *iface;
> >+
> >+ iface = malloc(sizeof(struct iface));
> >+ if (iface == NULL)
> >+ memory_allocation_error();
>
> Why not use x*alloc here?
Just changed this here, thanks.
BTW, not important but I'm still seeing netlink traffic here to
NETLINK_ROUTE. Looking at the glibc code, it seems that getaddrinfo()
also internally retrieves the list of interfaces via netlink for each
call.
next prev parent reply other threads:[~2015-04-06 12:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-06 12:06 [PATCH nft 1/2] src: introduce netlink_init_error() Pablo Neira Ayuso
2015-04-06 12:06 ` [PATCH nft 2/2] src: restore interface to index cache Pablo Neira Ayuso
2015-04-06 12:39 ` Patrick McHardy
2015-04-06 12:58 ` Pablo Neira Ayuso [this message]
2015-04-06 12:58 ` Patrick McHardy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150406125857.GA13992@salvia \
--to=pablo@netfilter.org \
--cc=kaber@trash.net \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).