~ubuntu-branches/ubuntu/vivid/wpasupplicant/vivid

« back to all changes in this revision

Viewing changes to driver_wext.c

  • Committer: Bazaar Package Importer
  • Author(s): Kel Modderman
  • Date: 2006-10-05 08:04:01 UTC
  • mfrom: (1.1.5 upstream) (3 etch)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20061005080401-r8lqlix4390yos7b
Tags: 0.5.5-2
* Update madwifi headers to latest SVN. (Closes: #388316)
* Remove failed attempt at action locking. [debian/functions.sh,
  debian/wpa_action.sh]
* Add hysteresis checking functions, to avoid "event loops" while
  using wpa-roam. [debian/functions.sh, debian/wpa_action.sh]
* Change of co-maintainer email address.
* Add ishex() function to functions.sh to determine wpa-psk value type in
  plaintext or hex. This effectively eliminates the need for the bogus and
  somewhat confusing wpa-passphrase contruct specific to our scripts and
  allows wpa-psk to work with either a 8 to 63 character long plaintext
  string or 64 character long hex string.
* Adjust README.modes to not refer to the redundant wpa-passphrase stuff.
* Add big fat NOTE about acceptable wpa-psk's to top of example gallery.
* Strip surrounding quotes from wpa-ssid if present, instead of just whining
  about them.
* Update email address in copyright blurb of functions.sh, ifupdown.sh and
  wpa_action.sh.  

Show diffs side-by-side

added added

removed removed

Lines of Context:
322
322
{
323
323
        union wpa_event_data data;
324
324
 
325
 
        wpa_printf(MSG_DEBUG, "Custom wireless event: '%s'", custom);
 
325
        wpa_printf(MSG_MSGDUMP, "WEXT: Custom wireless event: '%s'",
 
326
                   custom);
326
327
 
327
328
        memset(&data, 0, sizeof(data));
328
329
        /* Host AP driver */
653
654
                return;
654
655
        }
655
656
 
 
657
        wpa_printf(MSG_DEBUG, "RTM_NEWLINK: operstate=%d ifi_flags=0x%x "
 
658
                   "(%s%s%s%s)",
 
659
                   drv->operstate, ifi->ifi_flags,
 
660
                   (ifi->ifi_flags & IFF_UP) ? "[UP]" : "",
 
661
                   (ifi->ifi_flags & IFF_RUNNING) ? "[RUNNING]" : "",
 
662
                   (ifi->ifi_flags & IFF_LOWER_UP) ? "[LOWER_UP]" : "",
 
663
                   (ifi->ifi_flags & IFF_DORMANT) ? "[DORMANT" : "");
656
664
        /*
657
665
         * Some drivers send the association event before the operup event--in
658
666
         * this case, lifting operstate in wpa_driver_wext_set_operstate()
659
667
         * fails. This will hit us when wpa_supplicant does not need to do
660
668
         * IEEE 802.1X authentication
661
669
         */
662
 
        if (drv->ifindex == ifi->ifi_index && drv->operstate == 1 &&
 
670
        if (drv->operstate == 1 &&
663
671
            (ifi->ifi_flags & (IFF_LOWER_UP | IFF_DORMANT)) == IFF_LOWER_UP &&
664
672
            !(ifi->ifi_flags & IFF_RUNNING))
665
673
                wpa_driver_wext_send_oper_ifla(drv, -1, IF_OPER_UP);
729
737
        struct sockaddr_nl from;
730
738
        socklen_t fromlen;
731
739
        struct nlmsghdr *h;
 
740
        int max_events = 10;
732
741
 
 
742
try_again:
733
743
        fromlen = sizeof(from);
734
744
        left = recvfrom(sock, buf, sizeof(buf), MSG_DONTWAIT,
735
745
                        (struct sockaddr *) &from, &fromlen);
772
782
                wpa_printf(MSG_DEBUG, "%d extra bytes in the end of netlink "
773
783
                           "message", left);
774
784
        }
 
785
 
 
786
        if (--max_events > 0) {
 
787
                /*
 
788
                 * Try to receive all events in one eloop call in order to
 
789
                 * limit race condition on cases where AssocInfo event, Assoc
 
790
                 * event, and EAPOL frames are received more or less at the
 
791
                 * same time. We want to process the event messages first
 
792
                 * before starting EAPOL processing.
 
793
                 */
 
794
                goto try_again;
 
795
        }
775
796
}
776
797
 
777
798
 
1959
1980
{
1960
1981
        struct wpa_driver_wext_data *drv = priv;
1961
1982
 
 
1983
        wpa_printf(MSG_DEBUG, "%s: operstate %d->%d (%s)",
 
1984
                   __func__, drv->operstate, state, state ? "UP" : "DORMANT");
1962
1985
        drv->operstate = state;
1963
1986
        return wpa_driver_wext_send_oper_ifla(
1964
1987
                drv, -1, state ? IF_OPER_UP : IF_OPER_DORMANT);