HI Jouni &amp; Johannes,<br><br>Thanks a lot for your suggestions. I have generated a patch according to the comments below. Please see whether this is okay.<br><br>&gt; Another approach would be to name monitor interface as mon-%s-%d [for e.g<br>

&gt; mon-wlan0-0], by replacing &quot;p2p&quot; with &quot;mon&quot; for monitor interface [instead<br>
&gt; of appending &quot;mon.&quot; to p2p-wlan0-0]. This way<br>
&gt; size of monitor interface would be same as p2p interface. Hence monitor<br>
&gt; interface would reach size limit when exactly when p2p interface reaches<br>
&gt; size limit.<br>
<br>
I would be fine with this approach, too. And renaming &quot;mon.&quot; to &quot;m.&quot; is<br>
also fine in general.<br>
<div class="im"><br>
&gt; In this approach when p2p interface reaches the size limit, it would be<br>
&gt; reset to p2p-%d and hence the corresponding monitor will be mon-%d. This way<br>
&gt; the %d will always be in sync between monitor interface and corresponding GO<br>
&gt; interface. This change will only affect driver_nl80211.c. By this approach,<br>
&gt; it will take long time for the interface<br>
&gt; to get reset and even if it gets reset. It will be in sync with P2P<br>
&gt; Interface GROUP INDEX.<br>
<br>
</div>This is probably the quickest acceptable change, so it sounds like a<br>
good first step.<br><br><br>---<br> src/drivers/driver_nl80211.c |   14 +++++++++++++-<br> 1 files changed, 13 insertions(+), 1 deletions(-)<br><br>diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c<br>
index 6dfad0a..40b0295 100644<br>--- a/src/drivers/driver_nl80211.c<br>+++ b/src/drivers/driver_nl80211.c<br>@@ -4697,8 +4697,20 @@ nl80211_create_monitor_interface(struct wpa_driver_nl80211_data *drv)<br>        struct sockaddr_ll ll;<br>
        int optval;<br>        socklen_t optlen;<br>+       char *ifname = NULL;<br>+<br>+       if ((ifname = os_strstr(drv-&gt;first_bss.ifname, &quot;p2p-&quot;))) {<br>+               /* P2P interface name is of the format p2p-%s-%d. For monitor interface<br>
+                * name corresponding to P2P GO, replace &quot;p2p-&quot; with &quot;mon-&quot; to retain<br>+                * the same interface name length and to indicate that it is a monitor<br>+                * interface. */<br>
+               ifname += os_strlen(&quot;p2p-&quot;);<br>+       } else {<br>+               /* Non-P2P interface with AP functionality, if any.*/<br>+               ifname = drv-&gt;first_bss.ifname;<br>+       }<br>+       snprintf(buf, IFNAMSIZ, &quot;mon-%s&quot;, ifname);<br>
<br>-       snprintf(buf, IFNAMSIZ, &quot;mon.%s&quot;, drv-&gt;first_bss.ifname);<br>        buf[IFNAMSIZ - 1] = &#39;\0&#39;;<br><br>        drv-&gt;monitor_ifidx =<br>-- <br>1.7.4.1<br><br><br><br><br><br><br><br><br><br>
<br><br><br><div class="gmail_quote">On Thu, Oct 13, 2011 at 4:30 PM, Jouni Malinen <span dir="ltr">&lt;<a href="mailto:j@w1.fi">j@w1.fi</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Thu, Oct 13, 2011 at 12:21:52PM +0530, JJ wrote:<br>
&gt; We are not hitting interface size limit for p2p interface. But we are<br>
&gt; hitting the IFNAMSIZ for monitor interface<br>
&gt; corresponding to P2P GO. The base interface name is &quot;wlan0&quot;. so the p2p<br>
&gt; interface name would start from<br>
&gt; p2p-wlan0-0.<br>
<br>
</div>&gt; p2p-wlan0-10----------&gt; mon.p2p-wlan0-10 [size=16]<br>
<br>
Ah, I see.<br>
<div class="im"><br>
&gt; so after around 10 teardowns of P2P Group Owner, the monitor interface name<br>
&gt; reaches size limit. But currently, Interface name is reset only when the p2p<br>
&gt; interface reaches the IFNAMSIZ. Due to this the monitor interface name gets<br>
&gt; truncated [for e.g monitor interface would show mon.p2p-wlan0-1 for<br>
&gt; mon.p2p-wlan0-11], till the RESET happens.<br>
<br>
</div>There is not really any particular need for continuing to increment the<br>
counter in p2p-&lt;ifname&gt;-# continuously, i.e., that could be optimized to<br>
find the smaller number that provides a unique interface. The other<br>
option and maybe the best approach here would be to make the if_add()<br>
driver_ops in driver_nl80211.c force a shorter ifname if needed (return<br>
the new name by writing it to force_ifname). This is done by some other<br>
driver wrappers already for P2P use cases. The benefit here would be in<br>
hiding the monitor interface detail from the generic code.<br>
<div class="im"><br>
&gt; Since monitor interface name is derived from p2p interface name, ideally<br>
&gt; group index [%d] should be in sync so that a monitor interface can be<br>
&gt; associated with a corresponding p2p interface.<br>
<br>
</div>Yeah, that is kind of nice for debugging purposes.<br>
<div class="im"><br>
&gt; Another approach would be to name monitor interface as mon-%s-%d [for e.g<br>
&gt; mon-wlan0-0], by replacing &quot;p2p&quot; with &quot;mon&quot; for monitor interface [instead<br>
&gt; of appending &quot;mon.&quot; to p2p-wlan0-0]. This way<br>
&gt; size of monitor interface would be same as p2p interface. Hence monitor<br>
&gt; interface would reach size limit when exactly when p2p interface reaches<br>
&gt; size limit.<br>
<br>
</div>I would be fine with this approach, too. And renaming &quot;mon.&quot; to &quot;m.&quot; is<br>
also fine in general.<br>
<div class="im"><br>
&gt; In this approach when p2p interface reaches the size limit, it would be<br>
&gt; reset to p2p-%d and hence the corresponding monitor will be mon-%d. This way<br>
&gt; the %d will always be in sync between monitor interface and corresponding GO<br>
&gt; interface. This change will only affect driver_nl80211.c. By this approach,<br>
&gt; it will take long time for the interface<br>
&gt; to get reset and even if it gets reset. It will be in sync with P2P<br>
&gt; Interface GROUP INDEX.<br>
<br>
</div>This is probably the quickest acceptable change, so it sounds like a<br>
good first step.<br>
<div><div></div><div class="h5"><br>
--<br>
Jouni Malinen                                            PGP id EFC895FA<br>
_______________________________________________<br>
HostAP mailing list<br>
<a href="mailto:HostAP@lists.shmoo.com">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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><br><span style="font-family:courier new,monospace;color:rgb(102, 102, 102)">- <b><font size="2">Jithu Jance.</font></b></span><br><br>