Re: [PATCH 1/1] platform: extract common fields of IPv4/IPv6 addresses and routes to base struct



On Fri, 2014-04-04 at 15:13 -0500, Dan Williams wrote:
On Thu, 2014-04-03 at 14:23 +0200, Thomas Haller wrote:
Especially the calculation of timestamps is identicall for addresses.
By creating a "base struct", we can use the same code for that, because
NMPlatformIP4Address and NMPlatformIP6Address can now both be treated as
NMPlatformIPAddress (and the same for routes).

Is the only reason for the #define of the common fields so that you
don't have to do another level of indirection?  It looks somewhat ugly
and my personal preference would be to just declare the base struct in
the functions you want to use it in and up-cast if you need the v4 or v6
version...  kinda like we do with objects.  So I certainly agree with
the principle, but lets see what other people say about the
implementation...


Hi Dan,

could you elaborate an what would be your preference? I don't
understand.

Thomas

Attachment: signature.asc
Description: This is a digitally signed message part



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