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 

Minor issue in pcpserver.c (1.9.20150609)

 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Compilation/Installation
View previous topic :: View next topic  
Author Message
BoHiCa



Joined: 19 Jun 2015
Posts: 22

PostPosted: Fri Jun 19, 2015 5:47 pm    Post subject: Minor issue in pcpserver.c (1.9.20150609) Reply with quote

Hi Thomas!

First off: Thank you so much for the blood, sweat and tears you have put into miniupnpd over the years. It is a nice piece of work! So thanks for that!

The issue: I recently recompiled 1.9.20150609 on Linux® with PCP enabled, and the compiler complained about an undeclared variable in pcpserver.c. The snip below is the patch I applied to allow it to compile, but I am not familiar enough with the miniupnpd code-base to know if this was the proper and sane fix to the issue. Would you mind taking a look and letting me know if this is the proper fix?


Code:
--- ./sources/miniupnpd/miniupnpd-1.9.20150609/pcpserver.c   2014-10-27 11:40:35.000000000 -0500
+++ ./sources/miniupnpd/pcpserver.c.swe   2015-06-16 08:54:17.868263523 -0500
@@ -533,7 +533,7 @@
 #endif
       opt_flp = (pcp_flow_priority_option_t*)pcp_buf;
 
-      if ( option_length != sizeof (*flp) ) {
+      if ( option_length != sizeof (*opt_flp) ) {
          syslog(LOG_ERR, "PCP: Error processing DSCP. sizeof %d and remaining %d . flow len %d \n",
                 (int)sizeof(pcp_flow_priority_option_t), remain, opt_flp->len);
          pcp_msg_info->result_code = PCP_ERR_MALFORMED_OPTION;

The problem is on line 533 of the current pcpcserver.c sources. Also it looks like 'Peter Tatrai' is that author of the pcpserver.c code.

Thanks again!

PS: This might belong in the 'minupnpd Bugs' forum instead of here.
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1593

PostPosted: Mon Jun 22, 2015 7:23 am    Post subject: Reply with quote

the problem only shows when PCP_FLOWP is defined
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1593

PostPosted: Mon Jun 22, 2015 8:12 pm    Post subject: Reply with quote

https://github.com/miniupnp/miniupnp/commit/6400a13a50c06bfc3fad4e9ebb357d0dfc9645ed
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
BoHiCa



Joined: 19 Jun 2015
Posts: 22

PostPosted: Mon Jun 22, 2015 10:08 pm    Post subject: Reply with quote

Ah! You've read my mind on the return value ;^) Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Compilation/Installation 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.