Closed miniupnp closed 10 years ago
I have theses logs before :
0s 000ms 269us DEBUG : FILE: src/pcp_client_db.c:348; Func: get_pcp_server: BEGIN
0s 000ms 287us DEBUG : FILE: src/pcp_client_db.c:368; Func: get_pcp_server: END
0s 000ms 294us DEBUG : FILE: src/pcp_server_discovery.c:60; Func: psd_fill_pcp_server_src: BEGIN
0s 000ms 311us WARNING: FILE: src/pcp_server_discovery.c:118; Func: psd_fill_pcp_server_src:
Error (failed to connect to peer for src addr selection.) occurred while registering a new PCP server fe80::f6ca:e5ff:fe45:5e1a
0s 000ms 323us DEBUG : FILE: src/pcp_server_discovery.c:120; Func: psd_fill_pcp_server_src: END
0s 000ms 330us ERROR : FILE: src/pcp_server_discovery.c:164; Func: psd_add_gws:
Failed to initialize gateway fe80::f6ca:e5ff:fe45:5e1a as a PCP server.
0s 000ms 337us DEBUG : FILE: src/pcp_api.c:132; Func: pcp_init: END
I can see you have link local IPv6 address of gateway, and it seems to be an issue here. Because the code doesn't set scope_id. Try to disable autodiscovery with -d option and set pcp server manually, like this: pcp_app/pcp -d -s 10.0.0.1:5351 -i :12345 If you want to use IPv6 address you have to avoid use of link local addresses, the code doesn't work with them, yet.
when it fails to find the IPv6 address, the "server" should not be left in a state which is not handled properly by run_server_state_machine(). Or the server state machine should be improved to do something more intelligent than loop forever taking 100% of CPU time.
The stuff about link local IPv6 addresses is independent. It is always possible that an error occurs, it must be handled properly.
in psd_add_gws() I see that no action is taken if psd_fill_pcp_server_src() returns error, apart from outputing error log. Shouldn't it do s->state = pss_error;
or something like that ?
Commnit b4c09de should fix this. If you could give it a try.
it works
If I run
pcp_app/pcp -i :12345
it loops forever and output the following :