Re: [OpenWrt-Devel] miniupnpd state loss

2014-10-16 Thread Steven Barth
Your change completely disables reloading which breaks in case of wan
switching to a different interface or if lan interfaces are coming up.

I commited a change
https://github.com/openwrt-routing/packages/commit/8bc38fccc73b40e9599b897e335f2e7a5a67e879
which should avoid restarts in case wan interface flakes but stays the
same. Please test and let me know if this solves your issue.

Still miniunpd needs to be restarted in certain cases as noted above,
this will cause loss of state however this problem must be resolved
upstream as the program doesn't suppport a change of external or
addition of internal interfaces without a restart.


Cheers,

Steven
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] miniupnpd state loss

2014-10-16 Thread Kao Kevin
Hi Steve,

The solution works great. I have tested it.

Thanks
Kevin

-Original Message-
From: Steven Barth [mailto:cy...@openwrt.org] 
Sent: Thursday, October 16, 2014 4:48 AM
To: openwrt-devel@lists.openwrt.org
Cc: Kao Kevin
Subject: Re: [OpenWrt-Devel] miniupnpd state loss

Your change completely disables reloading which breaks in case of wan switching 
to a different interface or if lan interfaces are coming up.

I commited a change
https://github.com/openwrt-routing/packages/commit/8bc38fccc73b40e9599b897e335f2e7a5a67e879
which should avoid restarts in case wan interface flakes but stays the same. 
Please test and let me know if this solves your issue.

Still miniunpd needs to be restarted in certain cases as noted above, this will 
cause loss of state however this problem must be resolved upstream as the 
program doesn't suppport a change of external or addition of internal 
interfaces without a restart.


Cheers,

Steven

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] miniupnpd state loss

2014-10-16 Thread Luis E. Garcia
Steve,
Thanks for the fix. I had also experienced this issue.
Do you know if it is possible to back-port the fix BB14.07??

Regards,
Luis Garcia

On Thu, Oct 16, 2014 at 2:20 PM, Kao Kevin kevin@technicolor.com
wrote:

 Hi Steve,

 The solution works great. I have tested it.

 Thanks
 Kevin

 -Original Message-
 From: Steven Barth [mailto:cy...@openwrt.org]
 Sent: Thursday, October 16, 2014 4:48 AM
 To: openwrt-devel@lists.openwrt.org
 Cc: Kao Kevin
 Subject: Re: [OpenWrt-Devel] miniupnpd state loss

 Your change completely disables reloading which breaks in case of wan
 switching to a different interface or if lan interfaces are coming up.

 I commited a change

 https://github.com/openwrt-routing/packages/commit/8bc38fccc73b40e9599b897e335f2e7a5a67e879
 which should avoid restarts in case wan interface flakes but stays the
 same. Please test and let me know if this solves your issue.

 Still miniunpd needs to be restarted in certain cases as noted above, this
 will cause loss of state however this problem must be resolved upstream as
 the program doesn't suppport a change of external or addition of internal
 interfaces without a restart.


 Cheers,

 Steven

 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] miniupnpd state loss

2014-10-15 Thread Kao Kevin
Hi,

While Running tests in an openwrt based IP gateway, we noticed  openwrt hotplug 
restarts the minupnpd when Ethernet link goes up.
The restart results in the miniupnpd lossing its internal state and breaking 
the upnp GENA (General event notification arch) functions.

Please refer to the following tests for the problem description.

[wan]


[Device][lan][Gateway]


1.   Have Gateway wan link set to network1 with subnet 
a1.b1.c1.xx/255.255.255.0

2.   DHCP server in network1 assign Gateway wan IP as a1.b1.c1.01

3.   Device sends SUBSCRIBE for eventSubURL to Gateway

4.   Gateway returns 200 OK

5.   Gateway sends NOTIFY to device with ExternalIPAddress a1.b1.c1.01.

6.   Device sends 200 OK

7.   Bring wan link down

8.   Gateway sends NOTIFY with ExternalIPAddress with  WAN IP 0.0.0.0

9.   Device sends 200 OK

10.   Set the Gateway wan to network2   a2.b2.c2.xx/255.255.255.0

11.   DHCP server in network2 assign Gateway wan IP as a2.b2.c2.02

12.   Gateway sends NOTIFY with ExternalIPAddress a2.b2.c2.02.

13.   Device sends 200 OK

14.   Repeat step 7, bring wan link down

15.   Gateway should send NOTIFY as in step8; but it does not.

16.   Repeat step1, have gateway wan set to network

17.   Gateway should send NOTIFY as in step5; but it does not.

18.   Device sends UNSUBSCRIBE to Gateway

19.   Getway should send 200OK; but it sends 412 instead.





After investigating the cause, we found in between step12 and step13; the 
gateway miniupnpd receives a SIGTERM signal and restarted. As a result, the new 
miniupnpd losses the subscription state.

The SIGTERM is initiated  from the hotplug in the following code (in 
/etc/hotplug.d/iface/50-miniupnpd file)

--- Original script 


[ -f /var/state/bootnetwork ]  exit 0

/etc/init.d/miniupnpd enabled  [ $ACTION = ifup ]  {

local iface

for iface in $(uci_get upnpd config internal_iface; uci_get upnpd 
config external_iface); do

[ $INTERFACE = $iface ]  /etc/init.d/miniupnpd restart

done

}

--- 




Question1: is the restart for miniupnpd is necessary if it has been already 
running?

Question2:  We add the following code (in the modified section) in the 
50-miniupnp to escape the restart if the miniupnpd  service_check passed.

It seems the problem goes away. But we are not sure if 
the solution has no side effects. So, please anyone know this, give us a 
comment.



--- Modified script 


[ -f /var/state/bootnetwork ]  exit 0

# add the following 2 lines to avoid miniupnpd restarted if it pass the service 
check

. /lib/functions/service.sh

service_check /usr/sbin/miniupnpd  exit 0



/etc/init.d/miniupnpd enabled  [ $ACTION = ifup ]  {

local iface

for iface in $(uci_get upnpd config internal_iface; uci_get upnpd 
config external_iface); do

[ $INTERFACE = $iface ]  /etc/init.d/miniupnpd restart

done

}

--- 




Thanks

Kevin










image007.emz
Description: image007.emz


image009.emz
Description: image009.emz


image011.emz
Description: image011.emz


image014.emz
Description: image014.emz
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel