init-ifupdown: p2plink: allow to set persistent parameters

Use ifupdown variable 'p2p-network-id' to pass a WPA supplicant network
id, to pre-populate some parameters (SSID/passphrase) when creating the
group where this device is the GO.

Also replace go_intent=7 with the auto parameter. According to the
documentation:

    "auto" can be used to request wpa_supplicant to automatically
    figure out whether the peer device is operating as a GO and if so,
    use join-a-group operation rather than GO Negotiation.

https://jira.digi.com/browse/DEL-6741

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2019-09-10 11:49:00 +02:00
parent 73190ee6d4
commit 7013acc439
1 changed files with 2 additions and 1 deletions

View File

@ -24,6 +24,7 @@
# p2p-freq <channel-freq>
# p2p-local-address <local-ip>
# p2p-local-netmask <local-netmask>
# p2p-network-id <wpa_supplicant_conf P2P network ID>
#
# Execute only for the p2p0 interface
@ -54,7 +55,7 @@ if [ "${MODE}" = "start" ]; then
# Peer found, establish the link
log info "establish P2P link"
wpa_cli -i"${IFACE}" p2p_connect "${IF_P2P_PEER_MAC}" pbc go_intent=7 ${IF_P2P_FREQ:+freq=${IF_P2P_FREQ}}
wpa_cli -i"${IFACE}" p2p_connect "${IF_P2P_PEER_MAC}" pbc ${IF_P2P_NETWORK_ID:+persistent=${IF_P2P_NETWORK_ID}} ${IF_P2P_FREQ:+freq=${IF_P2P_FREQ}} auto
for _ in $(seq 20); do
if wpa_cli status 2>&1 | grep -qs "^wpa_state=COMPLETED$"; then
if wpa_cli status 2>&1 | grep -qs "^mode=P2P GO$"; then