Hi Jouni and Johannes,<div><br></div><div>Yes, I am trying to fix a bug related to generating random WPS ssid for each band, and thought this kind of change maybe necessary even without that random WPS ssid modification.</div>

<div>However, I seems to misunderstand how to use that SSID buffer. I will check it more.</div><div>Thanks for your responses. :)</div><div><br></div><div><br><br><div class="gmail_quote">
2011/12/10 Jouni Malinen <span dir="ltr">&lt;<a href="mailto:j@w1.fi" target="_blank">j@w1.fi</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Fri, Dec 09, 2011 at 01:10:10PM +0800, <a href="mailto:jungwalk@gmail.com" target="_blank">jungwalk@gmail.com</a> wrote:<br>


&gt; It is better to reset the ssid in WPS first before it is replaced with the one in<br>
&gt; credential in case the length of ssid in credential is longer than wps-&gt;ssid.<br>
<br>
</div>Are you trying to fix a bug that addresses some noticeable issue?<br>
<div><br>
&gt; @@ -318,6 +318,7 @@ static int hapd_wps_cred_cb(struct hostapd_data *hapd, void *ctx)<br>
</div><div>&gt; +     os_memset(hapd-&gt;wps-&gt;ssid, 0, HOSTAPD_MAX_SSID_LEN);<br>
&gt;       os_memcpy(hapd-&gt;wps-&gt;ssid, cred-&gt;ssid, cred-&gt;ssid_len);<br>
&gt;       hapd-&gt;wps-&gt;ssid_len = cred-&gt;ssid_len;<br>
<br>
</div>Like Johannes pointed out, this should not really result in any real<br>
change in actual behavior. If it does, there is likely a real bug<br>
somewhere else and that should be fixed. The SSID buffer is used as an<br>
arbitrary binary array of ssid_len octets and as such, there is no need<br>
to null-terminate it - the extra octets in the buffer are ignored.<br>
<font color="#888888"><br>
--<br>
Jouni Malinen                                            PGP id EFC895FA<br>
_______________________________________________<br>
HostAP mailing list<br>
<a href="mailto:HostAP@lists.shmoo.com" target="_blank">HostAP@lists.shmoo.com</a><br>
<a href="http://lists.shmoo.com/mailman/listinfo/hostap" target="_blank">http://lists.shmoo.com/mailman/listinfo/hostap</a><br>
</font></blockquote></div><br></div>