View previous topic :: View next topic |
Author |
Message |
trisk
Joined: 27 May 2008 Posts: 3
|
Posted: Wed May 28, 2008 6:18 pm Post subject: Use of anonymous union in natpmpresp_t causes problems |
|
|
The natpmpresp_t structure contains a union of two structs for an address or a port mapping. The union is anonymous, which is not allowed by ISO C (up to and including C99). This causes libnatpmp to fail to compile with non-GCC compilers.
A possible solution is to give the union a name, as in this patch:
(Stupid forum doesn't let me post links, I'll add it in a follow-up post)
Ignore the #ifdef __linux__ changes there for now, that's needed to compile on Solaris/OpenSolaris but means the code still doesn't work in that case. I'll submit a patch that correctly gets the gateway information through STREAMS TPI.
Last edited by trisk on Wed May 28, 2008 6:23 pm; edited 1 time in total |
|
Back to top |
|
|
trisk
Joined: 27 May 2008 Posts: 3
|
Posted: Wed May 28, 2008 6:18 pm Post subject: |
|
|
This is the patch I was referring to:
pkgbuild.svn.sourceforge.net/viewvc/*checkout*/pkgbuild/spec-files-extra/trunk/patches/transmission-01-sunpro.diff |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
|
Back to top |
|
|
trisk
Joined: 27 May 2008 Posts: 3
|
Posted: Sun Jun 29, 2008 7:06 pm Post subject: |
|
|
While I didn't have time, Darren Kenny wrote a getdefaultgateway implementation:
pkgbuild.svn.sourceforge.net/viewvc/*checkout*/pkgbuild/spec-files-extra/trunk/patches/transmission-01-solaris.diff
This has be tested on Solaris, but might also work for BSD and Mac OS X since they also use the PF_ROUTE interface. |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
|
Back to top |
|
|
|