UPnP support
-
Like this
if($config['installedpackages']['miniupnpd']['config'][0]['iface_array'])
$iface_array = explode(",",$config['installedpackages']['miniupnpd']['config'][0]['iface_array']);I've attached the files. I'm soo confused with this. Everything works perfect if it would only not duplicate the config section if no interfaces are selected. The package doesn't even do the writing of the config.
Also attached the status_upnp.php as the page will always redirect to setup page due to changing iface_array.
-
Like this
if($config['installedpackages']['miniupnpd']['config'][0]['iface_array'])
$iface_array = explode(",",$config['installedpackages']['miniupnpd']['config'][0]['iface_array']);I've attached the files. I'm soo confused with this. Everything works perfect if it would only not duplicate the config section if no interfaces are selected. The package doesn't even do the writing of the config.
Also attached the status_upnp.php as the page will always redirect to setup page due to changing iface_array.
If nobody sees the problem causing the above issue I have a workaround I am currently using. As seen below it will only rebuild the miniupnpd config section if you unselect all interfaces on the settings page, click change and then go back and renable miniupnpd on an interface.
Everything works. Multiple interface selection, selections are shown when returning to the settings page. Unselecting all interfaces and clicking change disables miniupnpd from running. When clicking miniupnpd on the menu you will receive the settings page where you can select an interface to enable it on.
If anybody would like to test it out I have the latest for embedded http://wgnrs.dynalias.com:81/pfsense/pfSense-Embedded-1.0-RELEASE-Miniupnpd.img.gz
if($_POST['iface_array'] && count($config['installedpackages']['miniupnpd']['config'])>1) { $config_array = &$config['installedpackages']['miniupnpd']['config']; /* delete every item leaving the array itself intact */ foreach ($config_array as $i => $value) { unset($config_array[$i]); } /* reindex the array */ $config_array = array_values($config_array); /* rebuild with correct values */ $config_array[0]['iface_array'] = implode(",", $_POST['iface_array']); $config_array[0]['overridewanip'] = $_POST['overridewanip']; /* make the changes final */ write_config(); log_error("miniupnpd: Rebuilt config as it contained duplicate information"); }
Attached is full miniupnpd.inc file. Once I get an answer on this I can make the appropriate changes.
-
Okay so I think the bug is in pfsense itself. It's not assigned the correct id in the form on pkg_edit.php
When interfaces are selcted and the settings page shown it shows id=0 which matches that config section in the xml file
<option value="lan" selected="">LAN</option>
….However when viewing the page when no interface is selected then the value is blank, which means when the config is changed it will add to the next available index in the config array.
<option value="lan">LAN</option>
....Maybe converting <iface_array>to the an array causes it to show null so pkg_edit.php thinks theres no exisitng data. Figuring out exactly the problem in pkg_edit.php would take me awhile since I don't know the code. Hopefully some of this makes sense and I am on the right track and one of the devs can correct the code.</iface_array>
-
if there is no interface selected then there need to be no config
so that when you select the page can make a new config section -
if there is no interface selected then there need to be no config
so that when you select the page can make a new config sectionWell the issue is not the new config, but that the new config is placed below the previous config instead of replacing it. You are correct that if there is no existing config it should make a new one. However the function in pkg_edit.php doesn't seem to realize there is an exisiting config.
-
I know others were having a problem with miniupnpd using close to 100% CPU before. For the first time I have had this error with the latest package. Here's the error that I noticed scattered throughout the log:
miniupnpd[85816]: recv (state0): Operation timed out
I guess its similar to what was posted earlier:
Oct 5 17:09:05 last message repeated 23845 times
Oct 5 17:08:34 miniupnpd[1359]: Unsupported HTTP Command SUBSCRIBE
Oct 5 17:08:34 miniupnpd[1359]: recv (state0): Connection reset by peer
Oct 5 17:08:34 last message repeated 5583 times
Oct 5 17:08:27 miniupnpd[1359]: Unsupported HTTP Command SUBSCRIBE
Oct 5 17:08:27 miniupnpd[1359]: recv (state0): Connection reset by peerIt's funny, I've never had that error before. This is on a fresh install of 1.0-RELEASE with the latest miniupnpd package installed from the package manager.
-
I know others were having a problem with miniupnpd using close to 100% CPU before. For the first time I have had this error with the latest package. Here's the error that I noticed scattered throughout the log:
miniupnpd[85816]: recv (state0): Operation timed out
I guess its similar to what was posted earlier:
Oct 5 17:09:05 last message repeated 23845 times
Oct 5 17:08:34 miniupnpd[1359]: Unsupported HTTP Command SUBSCRIBE
Oct 5 17:08:34 miniupnpd[1359]: recv (state0): Connection reset by peer
Oct 5 17:08:34 last message repeated 5583 times
Oct 5 17:08:27 miniupnpd[1359]: Unsupported HTTP Command SUBSCRIBE
Oct 5 17:08:27 miniupnpd[1359]: recv (state0): Connection reset by peerIt's funny, I've never had that error before. This is on a fresh install of 1.0-RELEASE with the latest miniupnpd package installed from the package manager.
Oct 5 17:08:27 miniupnpd[1359]: Unsupported HTTP Command SUBSCRIBE
Oct 5 17:08:27 miniupnpd[1359]: recv (state0): Connection reset by peerThis error was from a later version, but was rolledback to the previous version which is 20060924.
-
So I installed the last embedded image that was posted here and the following syslog results are obtained. I stopped the process via removing all interfaces in the Settings page after the soap errors.
10-20-2006 00:05:16 User.Notice 192.168.1.1 Oct 20 00:05:10 miniupnpd[3060]: received signal 15, exiting
10-20-2006 00:05:16 User.Warning 192.168.1.1 Oct 20 00:05:10 php: /pkg_edit.php: miniupnpd: No interfaces stopping service
10-20-2006 00:05:16 User.Warning 192.168.1.1 Oct 20 00:05:10 php: /pkg_edit.php: miniupnpd: Syncing package
10-20-2006 00:04:40 User.Notice 192.168.1.1 Oct 20 00:03:44 miniupnpd[3060]: Unknown soap method
10-20-2006 00:03:48 User.Notice 192.168.1.1 Oct 20 00:03:42 miniupnpd[3060]: Unknown soap method
10-20-2006 00:03:46 User.Warning 192.168.1.1 Oct 20 00:03:39 php: /pkg_edit.php: miniupnpd: Starting service
10-20-2006 00:03:45 User.Warning 192.168.1.1 Oct 20 00:03:39 php: /pkg_edit.php: miniupnpd: Active on lan interface
10-20-2006 00:03:45 User.Warning 192.168.1.1 Oct 20 00:03:39 php: /pkg_edit.php: miniupnpd: Syncing package -
So I installed the last embedded image that was posted here and the following syslog results are obtained. I stopped the process via removing all interfaces in the Settings page after the soap errors.
10-20-2006 00:05:16 User.Notice 192.168.1.1 Oct 20 00:05:10 miniupnpd[3060]: received signal 15, exiting
10-20-2006 00:05:16 User.Warning 192.168.1.1 Oct 20 00:05:10 php: /pkg_edit.php: miniupnpd: No interfaces stopping service
10-20-2006 00:05:16 User.Warning 192.168.1.1 Oct 20 00:05:10 php: /pkg_edit.php: miniupnpd: Syncing package
10-20-2006 00:04:40 User.Notice 192.168.1.1 Oct 20 00:03:44 miniupnpd[3060]: Unknown soap method
10-20-2006 00:03:48 User.Notice 192.168.1.1 Oct 20 00:03:42 miniupnpd[3060]: Unknown soap method
10-20-2006 00:03:46 User.Warning 192.168.1.1 Oct 20 00:03:39 php: /pkg_edit.php: miniupnpd: Starting service
10-20-2006 00:03:45 User.Warning 192.168.1.1 Oct 20 00:03:39 php: /pkg_edit.php: miniupnpd: Active on lan interface
10-20-2006 00:03:45 User.Warning 192.168.1.1 Oct 20 00:03:39 php: /pkg_edit.php: miniupnpd: Syncing packagethe user.warning messages can be ignored. I had them set to send out status message of the package process. I need to change the function call so they don't appear as warnings.
The unknown soap method is a normal occurance. I receive it every once in awhile. Something on the network is sending out a request to upnp thats unsupported. I get these multiple times per day. Its coming from my windows boxes. The message appears if I right click internet connection in my network places and click enable. I think windows tries to enable this through the day as well.
I think you will find dispite the soap method occurance that upnp works fine. You can always check the current mapped upnp ports on the status page for miniupnpd.
Also the miniupnpd image that I posted on here is just my compilation of 1.0-RELEASE and miniupnpd. I personally use this version, however packages on embedded systems arn't exactly supported.
-
Yeah, I included all the syslogs as a group rather than cherry picking.
The only important ones were the soap messages.
I do not see any mapped ports being setup no matter what I start on the LAN side.(all apps on XP, azureus, messenger, polling for upnp devices in network neighborhood). I'm running embedded on a nexcom box (Via C3 proc, 3xfxp interfaces) and everything else seems to be fine. I"m really just getting up to speed on pfsense and miniupnpd so I'm fighting a learning curve a bit as well. I was working with miniupnp on openbsd on the same box but was attracted by the nice featureset available out of the gate with pfsense. -
Yeah, I included all the syslogs as a group rather than cherry picking.
The only important ones were the soap messages.
I do not see any mapped ports being setup no matter what I start on the LAN side.(all apps on XP, azureus, messenger, polling for upnp devices in network neighborhood). I'm running embedded on a nexcom box (Via C3 proc, 3xfxp interfaces) and everything else seems to be fine. I"m really just getting up to speed on pfsense and miniupnpd so I'm fighting a learning curve a bit as well. I was working with miniupnp on openbsd on the same box but was attracted by the nice featureset available out of the gate with pfsense.Hmm I'm running the exact same image and on the status page with Azureus open I have ports being mapped. As a matter of fact I just reflashed the box this morning.
If you changed your lan interface IP address you either need to restart the box or goto the miniunpd settings page and click change to rebuild the startup file as it uses your lan ip. Maybe this is the problem in your case.
If your still having issues under diagnostics -> edit file open /usr/local/etc/rc.d/miniupnpd.sh and let me see the line similar to the following. It should be -i WANinterfacename -a LANipaddress
/usr/local/sbin/miniupnpd -p 2869 -i fxp2 -a 10.10.1.1
Also in Azureus goto the Plugins menu -> Log Views -> UpnP should look similar to the below.
[13:43:58] UPnP: root discovered: usn=uuid:00000000-0000-0000-0000-000000000000::upnp:rootdevice, location=http://10.10.1.1:2869/rootDesc.xml, ni=eth2,local=/10.10.1.150 [13:43:58] Device 'http://10.10.1.1:2869/rootDesc.xml' is ok: discover=0,found=0,read_ok=0,read_bad=0,map_ok=0,map_bad=0 [13:43:59] Downloading: http://10.10.1.1:2869/rootDesc.xml [13:43:59] Relative URL base is unspecified [13:43:59] BSD/pf router [13:43:59] dummy:desc=http://10.10.1.1:2869/dummy.xml, control=http://10.10.1.1:2869/dummy [13:43:59] WANDevice [13:43:59] urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1:desc=http://10.10.1.1:2869/WANCfg.xml, control=http://10.10.1.1:2869/control/WANCommonInterfaceConfig [13:43:59] WANConnectionDevice * [13:43:59] urn:schemas-upnp-org:service:WANIPConnection:1:desc=http://10.10.1.1:2869/WANIPCn.xml, control=http://10.10.1.1:2869/control/WANIPConnection [13:43:59] Found WANIPConnection [13:43:59] Downloading: http://10.10.1.1:2869/WANIPCn.xml [13:43:59] UPnP: Mapping 'Incoming Peer Data Port (UDP/6881)' established [13:43:59] Mapping UDP Tracker Client Port (UDP/6881) already established [13:43:59] UPnP: Mapping 'Incoming Peer Data Port (TCP/6881)' established [13:43:59] Mapping Distributed DB (UDP/6881) already established
-
I finally figured out the bug!!! Its been there from the originial version and I just overlooked it.
In status_upnp.php
if(!is_array($config['installedpackages']['miniupnpd']['config'][0]['interface_array']))
Header("Location: /pkg_edit.php?xml=miniupnpd.xml&id=0");the amp; shouldn't be there. Thus the pkg_edit.php file doesn't see the id number thinking it should add a new config section. This only happens when unselecting all the interfaces as you only get directed to the settings page from the status page if theres no interfaces selected.
Hopefully we can commit this now?? Sorry for trying to make the bug in the pfsense code. I've just spent hours on this and I really couldn't see the cause. I will post all the files and diff -rub files up in a few.
-
Here we go…
You can use the edit file menu option under diagnostics. Load each of the following and replace all the text (copy/paste) with the correct attached file. Make sure to click save.
/usr/local/pkg/miniupnpd.inc gets replaced with miniupnpd.inc.txt
/usr/local/pkg/miniupnpd.xml gets replaced with miniupnpd.xml.txt
/usr/local/www/status_upnp.php gets replaced with status_upnp.php.txtAfterwards goto the minupnpd settings page, make sure the correct interface is selected, most likely lan, and click change. This will recreate the config section and restart miniupnpd. Enjoy!
If you would rather just reflash you can download my compilation of 1.0-RELEASE with the package added here.
http://wgnrs.dynalias.com:81/pfsense/pfSense-Embedded-1.0-RELEASE-Miniupnpd.img.gz
Note: The unknown soap method in the system log is still present. I did not change the binary only the package configuration files. You can just ignore the above in the system log. It appears to be from windows systems and the internet connection (internet gateway) in the network connections. Windows trys to enable this which is unsupported by miniupnp.
miniupnpd.inc.diff.txt
miniupnpd.xml.diff.txt
status_upnp.php.diff.txt
miniupnpd.inc.txt
miniupnpd.xml.txt
status_upnp.php.txt -
There appears to be an update to miniupnpd which addresses the discover process searches for "InternetGatewayDevice" on XP, finally!
-
There appears to be an update to miniupnpd which addresses the discover process searches for "InternetGatewayDevice" on XP, finally!
Nice I noticed it just came out today. I don't know how to build the binary. Maybe one of the devs could give try this again. I know the last try to update broke miniupnpd. Maybe this will work better this time. Or if somebody could point me in the right direction on how to compile it with the changes for pfSense.
-
There appears to be an update to miniupnpd which addresses the discover process searches for "InternetGatewayDevice" on XP, finally!
Nice I noticed it just came out today. I don't know how to build the binary. Maybe one of the devs could give try this again. I know the last try to update broke miniupnpd. Maybe this will work better this time. Or if somebody could point me in the right direction on how to compile it with the changes for pfSense.
I built the new version however I am still getting all the same subscrube command errors that repeat thousands of times
Oct 21 13:28:41 last message repeated 4849 times
Oct 21 13:28:35 miniupnpd[43672]: Unsupported HTTP Command SUBSCRIBE
Oct 21 13:28:35 miniupnpd[43672]: recv (state0): Connection reset by peerSomething is broken in the new version or the old version just didn't output all the errors. I will look into it.
-
The update that was released on the 20th is for the client. Eventhough the client files are used when building the daemon, the files used do not differ from the previous version. The only difference is the daemon. I'm going to try and get the new daemon version to work.
As a test I rebuilt the version used in the package by hand and mine is identical to the pacakage version.
–-
You know the new version doesn't have more issues, the error reporting was changing from the standard output to syslog. Also theres a list of supported commands now and it errors on unsupported. I am going to finish going through it, build an vew version with the errors sent back to the standard output vs syslog and try it out.
-
Alright so heres the deal. The new version with its supported value lists disabled the internet connection (internet gateway) icon for upnp in my network connection on winxp. So we're loosing functionality as before you could add port maps through it.
However it does have other improvements. So I merged the improvements into the older version and rebuilt it. They are minor and probably won't help anybody out. I also disabled the error logging for the unknown soap method. I will post the link later.
-
I finally figured out the bug!!! Its been there from the originial version and I just overlooked it.
In status_upnp.php
if(!is_array($config['installedpackages']['miniupnpd']['config'][0]['interface_array']))
Header("Location: /pkg_edit.php?xml=miniupnpd.xml&id=0");the amp; shouldn't be there. Thus the pkg_edit.php file doesn't see the id number thinking it should add a new config section. This only happens when unselecting all the interfaces as you only get directed to the settings page from the status page if theres no interfaces selected.
Hopefully we can commit this now?? Sorry for trying to make the bug in the pfsense code. I've just spent hours on this and I really couldn't see the cause. I will post all the files and diff -rub files up in a few.
Commited, thanks.
–Bill
-
I'm working on a change for miniupnpd that will help winxp users trying to add port mappings. Its all done I just need to finish testing. In Network Connections -> Internet Connection -> Properties you can click settings and add port mappings. The issue is windows likes to convert the ip address to a hostname. Well miniupnpd needs an ip address and on the status page will show 0.0.0.0 for the mapping. I have corrected this in the code and will post the new binary and the diff -rub patches needed to compile probably tomorrow. Heres screenshot of what I'm talking about.