HI Jouni & 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>> Another approach would be to name monitor interface as mon-%s-%d [for e.g<br>
> mon-wlan0-0], by replacing "p2p" with "mon" for monitor interface [instead<br>
> of appending "mon." to p2p-wlan0-0]. This way<br>
> size of monitor interface would be same as p2p interface. Hence monitor<br>
> interface would reach size limit when exactly when p2p interface reaches<br>
> size limit.<br>
<br>
I would be fine with this approach, too. And renaming "mon." to "m." is<br>
also fine in general.<br>
<div class="im"><br>
> In this approach when p2p interface reaches the size limit, it would be<br>
> reset to p2p-%d and hence the corresponding monitor will be mon-%d. This way<br>
> the %d will always be in sync between monitor interface and corresponding GO<br>
> interface. This change will only affect driver_nl80211.c. By this approach,<br>
> it will take long time for the interface<br>
> to get reset and even if it gets reset. It will be in sync with P2P<br>
> 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->first_bss.ifname, "p2p-"))) {<br>+ /* P2P interface name is of the format p2p-%s-%d. For monitor interface<br>
+ * name corresponding to P2P GO, replace "p2p-" with "mon-" to retain<br>+ * the same interface name length and to indicate that it is a monitor<br>+ * interface. */<br>
+ ifname += os_strlen("p2p-");<br>+ } else {<br>+ /* Non-P2P interface with AP functionality, if any.*/<br>+ ifname = drv->first_bss.ifname;<br>+ }<br>+ snprintf(buf, IFNAMSIZ, "mon-%s", ifname);<br>
<br>- snprintf(buf, IFNAMSIZ, "mon.%s", drv->first_bss.ifname);<br> buf[IFNAMSIZ - 1] = '\0';<br><br> drv->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"><<a href="mailto:j@w1.fi">j@w1.fi</a>></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>
> We are not hitting interface size limit for p2p interface. But we are<br>
> hitting the IFNAMSIZ for monitor interface<br>
> corresponding to P2P GO. The base interface name is "wlan0". so the p2p<br>
> interface name would start from<br>
> p2p-wlan0-0.<br>
<br>
</div>> p2p-wlan0-10----------> mon.p2p-wlan0-10 [size=16]<br>
<br>
Ah, I see.<br>
<div class="im"><br>
> so after around 10 teardowns of P2P Group Owner, the monitor interface name<br>
> reaches size limit. But currently, Interface name is reset only when the p2p<br>
> interface reaches the IFNAMSIZ. Due to this the monitor interface name gets<br>
> truncated [for e.g monitor interface would show mon.p2p-wlan0-1 for<br>
> 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-<ifname>-# 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>
> Since monitor interface name is derived from p2p interface name, ideally<br>
> group index [%d] should be in sync so that a monitor interface can be<br>
> associated with a corresponding p2p interface.<br>
<br>
</div>Yeah, that is kind of nice for debugging purposes.<br>
<div class="im"><br>
> Another approach would be to name monitor interface as mon-%s-%d [for e.g<br>
> mon-wlan0-0], by replacing "p2p" with "mon" for monitor interface [instead<br>
> of appending "mon." to p2p-wlan0-0]. This way<br>
> size of monitor interface would be same as p2p interface. Hence monitor<br>
> interface would reach size limit when exactly when p2p interface reaches<br>
> size limit.<br>
<br>
</div>I would be fine with this approach, too. And renaming "mon." to "m." is<br>
also fine in general.<br>
<div class="im"><br>
> In this approach when p2p interface reaches the size limit, it would be<br>
> reset to p2p-%d and hence the corresponding monitor will be mon-%d. This way<br>
> the %d will always be in sync between monitor interface and corresponding GO<br>
> interface. This change will only affect driver_nl80211.c. By this approach,<br>
> it will take long time for the interface<br>
> to get reset and even if it gets reset. It will be in sync with P2P<br>
> 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>