Re: [PATCH 22/28] util: provide default destination IP in alternate virNetDevIPRouteAdd()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 06/22/2016 01:37 PM, Laine Stump wrote:
> The version of virNetDevIPRouteAdd() has a bit of code to create the
> appropriate "0.0.0.0" or "::" virSocketAddr when the addr passed in is
> NULL or invalid, but the alternate implementation (used on platforms
> that don't support libnl) had no such code, making the two
> implementations semantically diferent. This patch corrects that
> oversight.
> ---
>  src/util/virnetdevip.c | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
> 

Seems like a reasonable and nice thing to do ...  although you could
have written a helper routine to return the result of
virSocketAddrFormat based on actualAddr... Avoids duplicated code and
the chance that someone only changes one in the future.

Interesting side note - can gateway be invalid and family doesn't have
AF_INET, thus you create an IPv6 default address?

ACK - with the helper routine...

John

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]