P2P: Cleanup handling of unknown peer in PD Request processing
authorIlan Peer <ilan.peer@intel.com>
Thu, 8 Oct 2015 09:35:57 +0000 (12:35 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 11 Oct 2015 09:38:07 +0000 (12:38 +0300)
commit4acd5ac67b76d683a944bc03891c52759546841d
treecb56dc3dd2170bcce4d71dd8c6248d538932fccf
parentf56478ab88c4808089e7b22e3c240310544ed20b
P2P: Cleanup handling of unknown peer in PD Request processing

If a Provision Discovery Request is received for an unknown peer, a new
device entry is being added, but the flow continues without updating the
local p2p_device pointer, requiring to check the pointer value before
every access.

1. Change this, so once a device is added, the flow updates the local
   p2p_device pointer and avoids the checks later in the flow.
2. If the device is not known even after adding it, skip the processing,
   send the PD Response, and return.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
src/p2p/p2p_pd.c