[ovs-dev] [PATCH 4/6] tunneling: Handle multiple ip address for given device.

pravin shelar pshelar at ovn.org
Mon Mar 14 19:50:50 UTC 2016


On Thu, Mar 10, 2016 at 4:49 PM, Ben Pfaff <blp at ovn.org> wrote:
> On Wed, Mar 09, 2016 at 04:40:43PM -0800, Pravin B Shelar wrote:
>> From: Pravin B Shelar <pshelar at 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 <pshelar at 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.
>
ok. I have updated the doc. I have also added patch to remove
netdev_get_in4() to have IPv4 and v6 address handling ore uniform.

> 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.
>
ok

> 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.
>
ok.



More information about the dev mailing list