[ovs-discuss] porting question

Ben Pfaff blp at nicira.com
Mon Apr 28 22:36:39 UTC 2014


On Mon, Apr 28, 2014 at 03:06:50PM -0400, Mark Haywood wrote:
> I'm investigating porting the OVS code (well, at least the userspace
> portions) to Solaris. On my first stab, I immediately ran into a
> couple of issues,
> 
> 1 - lib/byte-order.h defines htonll and ntohll inline functions
> which are already defined as macros on Solaris resulting in compile
> time errors.
> 
> 2 - lib/flow.c references a structure ip6_ext that is defined in OVS
> in netinet/ip6.h. However, Solaris has its own version of
> netinet/ip6.h which supersedes the one
>      included by OVS.
> 
> I can certainly think of ways of working around these issues.
> However, it was my hope that, once I ported to Solaris, the changes
> could be incorporated
> back into the base source. Given that the OVS source has already
> been ported to FreeBSD and NetBSD, I assume issues like this have
> been encountered.
> Are there any general rules on how OS portability issues should be resolved?

Yes.

For 1, submit a patch to check for htonll and ntohll macros and skip
defining them if they exist.

2 doesn't make sense because OVS doesn't define such a struct outside
of "sparse"-specific or Windows-specific headers.  You shouldn't be
using those headers, and I can't imagine how the build system would
have pulled them in automatically.



More information about the discuss mailing list