miniupnp.tuxfamily.org Forum Index miniupnp.tuxfamily.org
The forum about miniupnp and libnatpmp
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Use of anonymous union in natpmpresp_t causes problems

 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> libnatpmp Bugs
View previous topic :: View next topic  
Author Message
trisk



Joined: 27 May 2008
Posts: 3

PostPosted: Wed May 28, 2008 6:18 pm    Post subject: Use of anonymous union in natpmpresp_t causes problems Reply with quote

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
View user's profile Send private message
trisk



Joined: 27 May 2008
Posts: 3

PostPosted: Wed May 28, 2008 6:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Thu May 29, 2008 9:08 am    Post subject: Reply with quote

Here are fixed sources : libnatpmp-20080529.tar.gz
I'm waiting for your Solaris implementation of getgateway.
Thanks
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
trisk



Joined: 27 May 2008
Posts: 3

PostPosted: Sun Jun 29, 2008 7:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Sun Jun 29, 2008 8:00 pm    Post subject: Reply with quote

thanks !

the updated version is available here : libnatpmp-20080630.tar.gz
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> libnatpmp Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP
© 2007 Thomas Bernard, author of MiniUPNP.