On Thu, Feb 28, 2019 at 05:23:08PM +0800, Hangbin Liu wrote: > This patch add team interface activebackup mode support. As linux team use > genl netlink message, when we get a rtnl link change notify, we have to setup > a new genl socket and request the current active port. > > v2: check nlmsg_len before copy rta_data > v3: a) Do not make rtnl_buf global as it may be freed by calling rtnl_close() > while we are using it in rtnl_link_status()
Ok. Makes sense. > int rtnl_link_status(int fd, char *device, rtnl_callback cb, void *ctx) > { > + char *rtnl_buf = NULL; > + int slave_index = -1; > index = if_nametoindex(device); > if (!rtnl_buf) { > - rtnl_len = 4096; > - rtnl_buf = malloc(rtnl_len); > + rtnl_buf = malloc(BUF_SIZE); So, this condition is now always true. Maybe it would be better to remove it to avoid confusion? Thanks, -- Miroslav Lichvar _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel