Changeset 222
- Timestamp:
- 03/04/10 16:17:14 (5 months ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
drv_mac80211.c (modified) (3 diffs)
-
ruby-lorcon/Lorcon2.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/drv_mac80211.c
r216 r222 77 77 if ((parent = nl80211_find_parent(context->vapname)) == NULL) { 78 78 if (nl80211_createvap(context->ifname, context->vapname, context->errstr) < 0) { 79 free(parent); 79 80 return -1; 80 81 } 81 } else {82 free(parent); 83 }82 } 83 84 free(parent); 84 85 85 86 if (ifconfig_delta_flags(context->vapname, context->errstr, … … 164 165 165 166 return 0; 167 } 168 169 int mac80211_getchan_cb(lorcon_t *context) { 170 int ch; 171 172 if ((ch = iwconfig_get_channel(context->vapname, context->errstr)) < 0) { 173 // Fall back to parent if vap doesn't act right (mac80211 seems to do this) 174 if ((ch = iwconfig_get_channel(context->ifname, context->errstr)) < 0) 175 return -1; 176 } 177 178 return ch; 166 179 } 167 180 … … 290 303 291 304 context->setchan_cb = mac80211_setchan_cb; 305 context->getchan_cb = mac80211_getchan_cb; 292 306 293 307 context->getmac_cb = mac80211_getmac_cb; 294 context->setmac_cb = mac80211_set chan_cb;308 context->setmac_cb = mac80211_setmac_cb; 295 309 296 310 context->auxptr = extras; -
trunk/ruby-lorcon/Lorcon2.c
r214 r222 507 507 } 508 508 509 static VALUE Lorcon_get_channel(VALUE self) { 510 struct rldev *rld; 511 Data_Get_Struct(self, struct rldev, rld); 512 return INT2FIX(lorcon_get_channel(rld->context)); 513 } 509 514 510 515 static void rblorcon_pcap_handler(rblorconjob_t *job, struct pcap_pkthdr *hdr, u_char *pkt){ … … 632 637 rb_define_method(cDevice, "filter=", Lorcon_set_filter, 1); 633 638 rb_define_method(cDevice, "channel=", Lorcon_set_channel, 1); 639 rb_define_method(cDevice, "channel", Lorcon_get_channel, 0); 634 640 635 641 rb_define_method(cDevice, "loop", Lorcon_capture_loop, -1);
