shill: ensure that the reference to the ppp_device_ is dropped in StopPPP.

When the PPP daemon terminates, Cellular::OnPPPDied and OnPPPDisconnected
are called.  OnPPPDisconnected releases the ppp_task_ and then calls
Disconnect/StopPPP.

StopPPP was exiting early if ppp_task_ is null.  Since in this case it is
null, StopPPP did not drop the reference to ppp_device_.  The DBus object
associated with the ppp_device_ remained registered.  So when PPP reconnects,
Shill will fail an assertion because the new PPP device duplicates the path
of an existing DBus object.

This patch ensures that the OnPPPDied flow will drop the refernece to the
ppp_device_.

BUG=b:19666697
TEST=Ran "killall -HUP pppd" and verified that Shill could survive pppd dying.

Change-Id: Id565f39fc7054ca5a245fe872d14ea57a21b01fc
Reviewed-on: https://chromium-review.googlesource.com/262056
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
2 files changed
tree: 3203ba647c1319dcd4d7275e267111b6aad3bf33
  1. bin/
  2. cellular/
  3. dbus_bindings/
  4. doc/
  5. ethernet/
  6. init/
  7. mobile_operator_db/
  8. net/
  9. pppoe/
  10. setup_wifi/
  11. shims/
  12. supplicant/
  13. test-scripts/
  14. udev/
  15. upstart/
  16. vpn/
  17. wifi/
  18. wimax/
  19. .gitignore
  20. accessor_interface.h
  21. active_link_monitor.cc
  22. active_link_monitor.h
  23. active_link_monitor_unittest.cc
  24. adaptor_interfaces.h
  25. arp_client.cc
  26. arp_client.h
  27. arp_client_test_helper.cc
  28. arp_client_test_helper.h
  29. arp_client_unittest.cc
  30. arp_packet.cc
  31. arp_packet.h
  32. arp_packet_unittest.cc
  33. async_connection.cc
  34. async_connection.h
  35. async_connection_unittest.cc
  36. callbacks.h
  37. certificate_file.cc
  38. certificate_file.h
  39. certificate_file_unittest.cc
  40. connection.cc
  41. connection.h
  42. connection_health_checker.cc
  43. connection_health_checker.h
  44. connection_health_checker_unittest.cc
  45. connection_info.cc
  46. connection_info.h
  47. connection_info_reader.cc
  48. connection_info_reader.h
  49. connection_info_reader_unittest.cc
  50. connection_info_unittest.cc
  51. connection_tester.cc
  52. connection_tester.h
  53. connection_tester_unittest.cc
  54. connection_unittest.cc
  55. connectivity_trial.cc
  56. connectivity_trial.h
  57. connectivity_trial_unittest.cc
  58. control_interface.h
  59. crypto_des_cbc.cc
  60. crypto_des_cbc.h
  61. crypto_des_cbc_unittest.cc
  62. crypto_interface.h
  63. crypto_provider.cc
  64. crypto_provider.h
  65. crypto_provider_unittest.cc
  66. crypto_rot47.cc
  67. crypto_rot47.h
  68. crypto_rot47_unittest.cc
  69. crypto_util_proxy.cc
  70. crypto_util_proxy.h
  71. crypto_util_proxy_unittest.cc
  72. dbus_adaptor.cc
  73. dbus_adaptor.h
  74. dbus_adaptor_unittest.cc
  75. dbus_async_call_helper.h
  76. dbus_control.cc
  77. dbus_control.h
  78. dbus_manager.cc
  79. dbus_manager.h
  80. dbus_manager_unittest.cc
  81. dbus_name_watcher.cc
  82. dbus_name_watcher.h
  83. dbus_name_watcher_unittest.cc
  84. dbus_properties.cc
  85. dbus_properties.h
  86. dbus_properties_proxy.cc
  87. dbus_properties_proxy.h
  88. dbus_properties_proxy_interface.h
  89. dbus_properties_unittest.cc
  90. dbus_property_matchers.h
  91. dbus_service_proxy.cc
  92. dbus_service_proxy.h
  93. dbus_service_proxy_interface.h
  94. dbus_variant_gmock_printer.cc
  95. dbus_variant_gmock_printer.h
  96. default_profile.cc
  97. default_profile.h
  98. default_profile_unittest.cc
  99. device.cc
  100. device.h
  101. device_claimer.cc
  102. device_claimer.h
  103. device_claimer_unittest.cc
  104. device_dbus_adaptor.cc
  105. device_dbus_adaptor.h
  106. device_info.cc
  107. device_info.h
  108. device_info_unittest.cc
  109. device_stub.h
  110. device_unittest.cc
  111. dhcp_config.cc
  112. dhcp_config.h
  113. dhcp_config_unittest.cc
  114. dhcp_provider.cc
  115. dhcp_provider.h
  116. dhcp_provider_unittest.cc
  117. dhcp_proxy_interface.h
  118. dhcpcd_proxy.cc
  119. dhcpcd_proxy.h
  120. diagnostics_reporter.cc
  121. diagnostics_reporter.h
  122. diagnostics_reporter_unittest.cc
  123. dns_client.cc
  124. dns_client.h
  125. dns_client_factory.cc
  126. dns_client_factory.h
  127. dns_client_unittest.cc
  128. dns_server_tester.cc
  129. dns_server_tester.h
  130. dns_server_tester_unittest.cc
  131. eap_credentials.cc
  132. eap_credentials.h
  133. eap_credentials_unittest.cc
  134. eap_listener.cc
  135. eap_listener.h
  136. eap_listener_unittest.cc
  137. eap_protocol.h
  138. endpoint.cc
  139. endpoint.h
  140. ephemeral_profile.cc
  141. ephemeral_profile.h
  142. error.cc
  143. error.h
  144. error_unittest.cc
  145. event_dispatcher.cc
  146. event_dispatcher.h
  147. external_task.cc
  148. external_task.h
  149. external_task_unittest.cc
  150. file_io.cc
  151. file_io.h
  152. file_reader.cc
  153. file_reader.h
  154. file_reader_unittest.cc
  155. geolocation_info.cc
  156. geolocation_info.h
  157. glib.cc
  158. glib.h
  159. glib_io_handler_factory.cc
  160. glib_io_handler_factory.h
  161. glib_io_input_handler.cc
  162. glib_io_input_handler.h
  163. glib_io_ready_handler.cc
  164. glib_io_ready_handler.h
  165. HACKING
  166. hook_table.cc
  167. hook_table.h
  168. hook_table_unittest.cc
  169. http_proxy.cc
  170. http_proxy.h
  171. http_proxy_unittest.cc
  172. http_request.cc
  173. http_request.h
  174. http_request_unittest.cc
  175. http_url.cc
  176. http_url.h
  177. http_url_unittest.cc
  178. icmp.cc
  179. icmp.h
  180. icmp_unittest.cc
  181. ip_address_store.cc
  182. ip_address_store.h
  183. ip_address_store_unittest.cc
  184. ipconfig.cc
  185. ipconfig.h
  186. ipconfig_dbus_adaptor.cc
  187. ipconfig_dbus_adaptor.h
  188. ipconfig_unittest.cc
  189. key_file_store.cc
  190. key_file_store.h
  191. key_file_store_unittest.cc
  192. key_value_store.cc
  193. key_value_store.h
  194. key_value_store_unittest.cc
  195. link_monitor.cc
  196. link_monitor.h
  197. link_monitor_unittest.cc
  198. logging.cc
  199. logging.h
  200. manager.cc
  201. manager.h
  202. manager_dbus_adaptor.cc
  203. manager_dbus_adaptor.h
  204. manager_unittest.cc
  205. metrics.cc
  206. metrics.h
  207. metrics_unittest.cc
  208. mock_active_link_monitor.cc
  209. mock_active_link_monitor.h
  210. mock_adaptors.cc
  211. mock_adaptors.h
  212. mock_ares.cc
  213. mock_ares.h
  214. mock_arp_client.cc
  215. mock_arp_client.h
  216. mock_async_connection.cc
  217. mock_async_connection.h
  218. mock_certificate_file.cc
  219. mock_certificate_file.h
  220. mock_connection.cc
  221. mock_connection.h
  222. mock_connection_health_checker.cc
  223. mock_connection_health_checker.h
  224. mock_connection_info_reader.cc
  225. mock_connection_info_reader.h
  226. mock_connectivity_trial.cc
  227. mock_connectivity_trial.h
  228. mock_control.cc
  229. mock_control.h
  230. mock_crypto_util_proxy.cc
  231. mock_crypto_util_proxy.h
  232. mock_dbus_manager.cc
  233. mock_dbus_manager.h
  234. mock_dbus_properties_proxy.cc
  235. mock_dbus_properties_proxy.h
  236. mock_dbus_service_proxy.cc
  237. mock_dbus_service_proxy.h
  238. mock_device.cc
  239. mock_device.h
  240. mock_device_claimer.cc
  241. mock_device_claimer.h
  242. mock_device_info.cc
  243. mock_device_info.h
  244. mock_dhcp_config.cc
  245. mock_dhcp_config.h
  246. mock_dhcp_provider.cc
  247. mock_dhcp_provider.h
  248. mock_dhcp_proxy.cc
  249. mock_dhcp_proxy.h
  250. mock_diagnostics_reporter.cc
  251. mock_diagnostics_reporter.h
  252. mock_dns_client.cc
  253. mock_dns_client.h
  254. mock_dns_client_factory.cc
  255. mock_dns_client_factory.h
  256. mock_dns_server_tester.cc
  257. mock_dns_server_tester.h
  258. mock_eap_credentials.cc
  259. mock_eap_credentials.h
  260. mock_eap_listener.cc
  261. mock_eap_listener.h
  262. mock_event_dispatcher.cc
  263. mock_event_dispatcher.h
  264. mock_external_task.cc
  265. mock_external_task.h
  266. mock_file_io.h
  267. mock_glib.cc
  268. mock_glib.h
  269. mock_http_request.cc
  270. mock_http_request.h
  271. mock_ip_address_store.cc
  272. mock_ip_address_store.h
  273. mock_ipconfig.cc
  274. mock_ipconfig.h
  275. mock_link_monitor.cc
  276. mock_link_monitor.h
  277. mock_log.cc
  278. mock_log.h
  279. mock_log_unittest.cc
  280. mock_manager.cc
  281. mock_manager.h
  282. mock_metrics.cc
  283. mock_metrics.h
  284. mock_passive_link_monitor.cc
  285. mock_passive_link_monitor.h
  286. mock_pending_activation_store.cc
  287. mock_pending_activation_store.h
  288. mock_permission_broker_proxy.h
  289. mock_portal_detector.cc
  290. mock_portal_detector.h
  291. mock_power_manager.cc
  292. mock_power_manager.h
  293. mock_power_manager_proxy.cc
  294. mock_power_manager_proxy.h
  295. mock_ppp_device.cc
  296. mock_ppp_device.h
  297. mock_ppp_device_factory.cc
  298. mock_ppp_device_factory.h
  299. mock_process_killer.cc
  300. mock_process_killer.h
  301. mock_profile.cc
  302. mock_profile.h
  303. mock_property_store.cc
  304. mock_property_store.h
  305. mock_proxy_factory.cc
  306. mock_proxy_factory.h
  307. mock_resolver.cc
  308. mock_resolver.h
  309. mock_routing_table.cc
  310. mock_routing_table.h
  311. mock_service.cc
  312. mock_service.h
  313. mock_socket_info_reader.cc
  314. mock_socket_info_reader.h
  315. mock_store.cc
  316. mock_store.h
  317. mock_traffic_monitor.cc
  318. mock_traffic_monitor.h
  319. mock_virtual_device.cc
  320. mock_virtual_device.h
  321. NETLINK_MESSAGES.txt
  322. nice_mock_control.cc
  323. nice_mock_control.h
  324. OWNERS
  325. passive_link_monitor.cc
  326. passive_link_monitor.h
  327. passive_link_monitor_unittest.cc
  328. pending_activation_store.cc
  329. pending_activation_store.h
  330. pending_activation_store_unittest.cc
  331. permission_broker_proxy.cc
  332. permission_broker_proxy.h
  333. portal_detector.cc
  334. portal_detector.h
  335. portal_detector_unittest.cc
  336. power_manager.cc
  337. power_manager.h
  338. power_manager_proxy.cc
  339. power_manager_proxy.h
  340. power_manager_proxy_interface.h
  341. power_manager_unittest.cc
  342. ppp_daemon.cc
  343. ppp_daemon.h
  344. ppp_daemon_unittest.cc
  345. ppp_device.cc
  346. ppp_device.h
  347. ppp_device_factory.cc
  348. ppp_device_factory.h
  349. ppp_device_unittest.cc
  350. process_killer.cc
  351. process_killer.h
  352. process_killer_unittest.cc
  353. profile.cc
  354. profile.h
  355. profile_dbus_adaptor.cc
  356. profile_dbus_adaptor.h
  357. profile_dbus_property_exporter.cc
  358. profile_dbus_property_exporter.h
  359. profile_dbus_property_exporter_unittest.cc
  360. profile_unittest.cc
  361. property_accessor.h
  362. property_accessor_unittest.cc
  363. property_iterator.h
  364. property_observer.h
  365. property_observer_interface.h
  366. property_observer_unittest.cc
  367. property_store.cc
  368. property_store.h
  369. property_store_unittest.cc
  370. property_store_unittest.h
  371. protobuf_lite_streams.cc
  372. protobuf_lite_streams.h
  373. provider_db_unittest.bfd
  374. provider_interface.h
  375. proxy_factory.cc
  376. proxy_factory.h
  377. refptr_types.h
  378. resolver.cc
  379. resolver.h
  380. resolver_unittest.cc
  381. result_aggregator.cc
  382. result_aggregator.h
  383. result_aggregator_unittest.cc
  384. routing_table.cc
  385. routing_table.h
  386. routing_table_entry.h
  387. routing_table_unittest.cc
  388. rpc_task.cc
  389. rpc_task.h
  390. rpc_task_dbus_adaptor.cc
  391. rpc_task_dbus_adaptor.h
  392. rpc_task_unittest.cc
  393. scope_logger.cc
  394. scope_logger.h
  395. scope_logger_unittest.cc
  396. scoped_umask.cc
  397. scoped_umask.h
  398. service.cc
  399. service.h
  400. service_dbus_adaptor.cc
  401. service_dbus_adaptor.h
  402. service_property_change_notifier.cc
  403. service_property_change_notifier.h
  404. service_property_change_test.cc
  405. service_property_change_test.h
  406. service_sorter.h
  407. service_under_test.cc
  408. service_under_test.h
  409. service_unittest.cc
  410. shared_dbus_connection.cc
  411. shared_dbus_connection.h
  412. shill.gyp
  413. shill.gypi
  414. shill_ares.cc
  415. shill_ares.h
  416. shill_config.cc
  417. shill_config.h
  418. shill_daemon.cc
  419. shill_daemon.h
  420. shill_export.h
  421. shill_main.cc
  422. shill_test_config.cc
  423. shill_test_config.h
  424. shill_unittest.cc
  425. socket_info.cc
  426. socket_info.h
  427. socket_info_reader.cc
  428. socket_info_reader.h
  429. socket_info_reader_unittest.cc
  430. socket_info_unittest.cc
  431. static_ip_parameters.cc
  432. static_ip_parameters.h
  433. static_ip_parameters_unittest.cc
  434. store_interface.h
  435. stub_storage.h
  436. technology.cc
  437. technology.h
  438. technology_unittest.cc
  439. TESTING
  440. testing.h
  441. testrunner.cc
  442. tethering.cc
  443. tethering.h
  444. traffic_monitor.cc
  445. traffic_monitor.h
  446. traffic_monitor_unittest.cc
  447. virtual_device.cc
  448. virtual_device.h
  449. virtual_device_unittest.cc