On Wed, Mar 09, 2016 at 04:40:43PM -0800, Pravin B Shelar wrote: > From: Pravin B Shelar <pshe...@nicira.com> > > Device can have multiple IP address but netdev_get_in4/6() > returns only one configured IPv6 address. Following > patch fixes it. > OVS router is also updated to return source ip address for > given destination, This is required when interface has multiple > IP address configured. > > Signed-off-by: Pravin B Shelar <pshe...@ovn.org>
I guess that netdev_get_addr_list() needs an updated function comment. In particular, it should probably mention that the function both IPv4 and IPv6 addresses. get_src_addr() in ovs-router.c appears to use an inconsistent return value convention: sometimes it returns positive errors, sometimes negative ones. The function name __map_insert_ipdev() uses the namespace reserved to the C implementation. That's why we usually put the __ at the end of a name. I think that insert_ipdev__() leaks a reference to 'dev' here: ip_dev = xzalloc(sizeof *ip_dev); ip_dev->dev = netdev_ref(dev); ip_dev->change_seq = netdev_get_change_seq(dev); error = netdev_get_etheraddr(ip_dev->dev, &ip_dev->mac); if (error) { free(ip_dev); return; } When insert_ipdev__() fails, I think that it leaks its 'addr' parameter. Thanks, Ben. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev