Am 6. April 2015 14:58:57 MESZ, schrieb Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>: >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@xxxxxxxxxxxxx>: >[...] >> >+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. Makes sense since it doesn't know when to invalidate a cache. Which raises a question - do we need to listen to updates for interactive mode? I'd say yes. -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html