<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:16px"><div id="yui_3_16_0_1_1433900136765_3410">
</div><div class="" style="margin-bottom: 0in; line-height: 100%">Hi,</div>
<div id="yui_3_16_0_1_1433900136765_3472" class="" style="margin-bottom: 0in; line-height: 100%"><br style="" class="">
</div>
<div id="yui_3_16_0_1_1433900136765_3473" class="" style="margin-bottom: 0in; line-height: 100%">I have wpa_cli
started as a daemon running in background along with the
corresponding wpa_supplicant daemon. The wpa_cli carries out dhcp
session management using an action script. I have noticed
occasionally wpa_cli gives up running. I want to make sure wpa_cli
will be there as long as wpa_supplcant is there.</div>
<div id="yui_3_16_0_1_1433900136765_3474" class="" style="margin-bottom: 0in; line-height: 100%"><br style="" class="">
</div>
<div id="yui_3_16_0_1_1433900136765_3475" class="" style="margin-bottom: 0in; line-height: 100%">In wpa_cli code, inside wpa_cli_action(struct wpa_ctrl *ctrl) function, I have noticed following
line of code. I suspect it is giving up because it may have missed a
PING response.</div>
<div id="yui_3_16_0_1_1433900136765_3505" class="" style="margin-bottom: 0in; line-height: 100%"><br style="" class="">
</div>
<div id="yui_3_16_0_1_1433900136765_3506" class="" style="margin-bottom: 0in; line-height: 100%">My question is, If I
commented out line 02161, the "break;” statement, will it contribute to any
unexpected behavior.</div>
<div id="yui_3_16_0_1_1433900136765_3504" class="" style="margin-bottom: 0in; line-height: 100%"><br style="" class="">
</div>
<div id="yui_3_16_0_1_1433900136765_3503" class="" style="margin-bottom: 0in; line-height: 100%"><br style="" class="">
</div>
<div id="yui_3_16_0_1_1433900136765_3502" class="" style="margin-bottom: 0in; line-height: 100%"><br style="" class="">
</div>
<pre id="yui_3_16_0_1_1433900136765_3533" style="" class="">if (FD_ISSET(fd, &rfds))
<a href="" style="" class="" name="l02152"></a>02152 wpa_cli_recv_pending(ctrl, 0, 1);
<a href="" style="" class="" name="l02153"></a>02153 else {
<a href="" style="" class="" name="l02154"></a>02154 /* verify that connection is still working */
<a href="" style="" class="" name="l02155"></a>02155 len = sizeof(buf) - 1;
<a href="" style="" class="" name="l02156"></a>02156 if (<a id="yui_3_16_0_1_1433900136765_3534" style="" class="" href="http://docs.ros.org/diamondback/api/wpa_supplicant/html/wpa__ctrl_8h.html#ab88b3aee5c305873e06b2cfb5d4a7f3a">wpa_ctrl_request</a>(ctrl, "PING", 4, buf, &len,
<a href="" style="" class="" name="l02157"></a>02157 wpa_cli_action_cb) < 0 ||
<a href="" style="" class="" name="l02158"></a>02158 len < 4 || <a style="" class="" href="http://docs.ros.org/diamondback/api/wpa_supplicant/html/os_8h.html#adacd005b682d19934e90816786fb4594">os_memcmp</a>(buf, "PONG", 4) != 0) {
<a href="" style="" class="" name="l02159"></a>02159 <a style="" class="" href="http://docs.ros.org/diamondback/api/wpa_supplicant/html/wpagui_8cpp.html#a3cb9f0894fab1c8fbb0753c9c7c2a8d9">printf</a>("wpa_supplicant did not reply to PING "
<a href="" style="" class="" name="l02160"></a>02160 "command - exiting\n");
<a href="" style="" class="" name="l02161"></a>02161 break;
<a href="" style="" class="" name="l02162"></a>02162 }
<a href="" style="" class="" name="l02163"></a>02163 }</pre><div id="yui_3_16_0_1_1433900136765_3590" class="" style="margin-bottom: 0in; line-height: 100%">
Thanks</div>
<div id="yui_3_16_0_1_1433900136765_3591" class="" style="margin-bottom: 0in; line-height: 100%"><br style="" class="">
</div>
<div id="yui_3_16_0_1_1433900136765_3592" class="" style="margin-bottom: 0in; line-height: 100%">Samitha</div>
<div id="yui_3_16_0_1_1433900136765_3593" class="" style="margin-bottom: 0in; line-height: 100%"><br style="" class="">
</div><div dir="ltr">
</div><div style="" class="" id="yui_3_16_0_1_1433900136765_3410"><br style="" class=""></div></div></body></html>