initial import
[libicd-wpa] / patches / wpasupplicant-0.6.4.patch
diff --git a/patches/wpasupplicant-0.6.4.patch b/patches/wpasupplicant-0.6.4.patch
new file mode 100644 (file)
index 0000000..97f4fdb
--- /dev/null
@@ -0,0 +1,324 @@
+diff -rup wpasupplicant-0.6.4.orig/debian/changelog wpasupplicant-0.6.4/debian/changelog
+--- wpasupplicant-0.6.4.orig/debian/changelog  2009-03-02 14:03:10.000000000 +0100
++++ wpasupplicant-0.6.4/debian/changelog       2009-02-20 12:31:12.000000000 +0100
+@@ -1,3 +1,9 @@
++wpasupplicant (0.6.4-3+n810) unstable; urgency=low
++
++  * Some hacks for cx3110x support. 
++
++ -- Reinhard Tartler <siretart@tauware.de>  Fri, 20 Feb 2009 12:30:44 +0100
++
+ wpasupplicant (0.6.4-3) unstable; urgency=low
+   * Bugfix: "Missing -d in testing for a directory in init script". 
+diff -rup wpasupplicant-0.6.4.orig/debian/compat wpasupplicant-0.6.4/debian/compat
+--- wpasupplicant-0.6.4.orig/debian/compat     2009-03-02 14:03:10.000000000 +0100
++++ wpasupplicant-0.6.4/debian/compat  2009-02-16 20:50:34.000000000 +0100
+@@ -1 +1 @@
+-6
++5
+diff -rup wpasupplicant-0.6.4.orig/debian/config/linux wpasupplicant-0.6.4/debian/config/linux
+--- wpasupplicant-0.6.4.orig/debian/config/linux       2009-03-02 14:03:10.000000000 +0100
++++ wpasupplicant-0.6.4/debian/config/linux    2009-02-22 14:11:17.000000000 +0100
+@@ -27,7 +27,7 @@
+ #CONFIG_DRIVER_NDISWRAPPER=y
+ # Driver interface for Atmel driver
+-CONFIG_DRIVER_ATMEL=y
++#CONFIG_DRIVER_ATMEL=y
+ # Driver interface for Broadcom driver
+ # XXX: Non-GPL header required
+@@ -108,7 +108,7 @@ CONFIG_EAP_GTC=y
+ CONFIG_EAP_OTP=y
+ # EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used)
+-CONFIG_EAP_SIM=y
++#CONFIG_EAP_SIM=y
+ # EAP-PSK (experimental; this is _not_ needed for WPA-PSK)
+ CONFIG_EAP_PSK=y
+@@ -120,7 +120,7 @@ CONFIG_EAP_PAX=y
+ CONFIG_EAP_LEAP=y
+ # EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
+-CONFIG_EAP_AKA=y
++#CONFIG_EAP_AKA=y
+ # EAP-SAKE
+ #CONFIG_EAP_SAKE=y
+@@ -145,11 +145,11 @@ CONFIG_PKCS12=y
+ # Smartcard support (i.e., private key on a smartcard), e.g., with openssl
+ # engine.
+-CONFIG_SMARTCARD=y
++#CONFIG_SMARTCARD=y
+ # PC/SC interface for smartcards (USIM, GSM SIM)
+ # Enable this if EAP-SIM or EAP-AKA is included
+-CONFIG_PCSC=y
++#CONFIG_PCSC=y
+ # Development testing
+ #CONFIG_EAPOL_TEST=y
+@@ -251,7 +251,7 @@ CONFIG_PEERKEY=y
+ # This version is an experimental implementation based on IEEE 802.11w/D1.0
+ # draft and is subject to change since the standard has not yet been finalized.
+ # Driver support is also needed for IEEE 802.11w.
+-CONFIG_IEEE80211W=y
++#CONFIG_IEEE80211W=y
+ # Select TLS implementation
+ # openssl = OpenSSL (default)
+diff -rup wpasupplicant-0.6.4.orig/debian/control wpasupplicant-0.6.4/debian/control
+--- wpasupplicant-0.6.4.orig/debian/control    2009-03-02 14:03:10.000000000 +0100
++++ wpasupplicant-0.6.4/debian/control 2009-02-16 20:58:44.000000000 +0100
+@@ -1,21 +1,14 @@
+ Source: wpasupplicant
+ Section: net
+ Priority: optional
+-Maintainer: Debian/Ubuntu wpasupplicant Maintainers <pkg-wpa-devel@lists.alioth.debian.org>
+-Uploaders: Kyle McMartin <kyle@debian.org>, Reinhard Tartler <siretart@tauware.de>, Kel Modderman <kel@otaku42.de>
+-Build-Depends: debhelper (>= 6),
++Maintainer: javispedro
++Build-Depends: debhelper,
+  quilt,
+  libdbus-glib-1-dev,
+  libssl-dev,
+- libpcsclite-dev,
+- libreadline5-dev,
+- libqt4-dev,
++ libreadline4-dev,
+  libdbus-1-dev,
+- docbook,
+- docbook-utils,
+  pkg-config,
+- libpcap-dev [kfreebsd-i386 kfreebsd-amd64],
+- libbsd [kfreebsd-i386 kfreebsd-amd64]
+ Standards-Version: 3.8.0
+ Vcs-Svn: svn://svn.debian.org/pkg-wpa/wpasupplicant/trunk
+ Vcs-Browser: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/
+@@ -23,19 +16,11 @@ Homepage: http://w1.fi/wpa_supplicant/
+ Package: wpasupplicant
+ Architecture: any
+-Depends: ${shlibs:Depends}, lsb-base (>= 3.0-6), adduser
++Depends: ${shlibs:Depends}, lsb-base (>= 3.0-6)
+ Suggests: wpagui, libengine-pkcs11-openssl
+ Description: Client support for WPA and WPA2 (IEEE 802.11i)
+  WPA and WPA2 are methods for securing wireless networks, the former
+  using IEEE 802.1X, and the latter using IEEE 802.11i. This software
+  provides key negotiation with the WPA Authenticator, and controls
+  association with IEEE 802.11i networks.
+-
+-Package: wpagui
+-Architecture: any
+-Depends: ${shlibs:Depends}, wpasupplicant (= ${binary:Version})
+-Description: GUI for wpa_supplicant
+- wpagui provides a Qt interface for choosing which configured network
+- to connect to. It also provides a method for browsing 802.11 SSID scan
+- results, an event history log of messages generated by wpa_supplicant,
+- and a method to add or edit wpa_supplicant networks.
++ 
+diff -rup wpasupplicant-0.6.4.orig/debian/patches/series wpasupplicant-0.6.4/debian/patches/series
+--- wpasupplicant-0.6.4.orig/debian/patches/series     2009-03-02 14:03:10.000000000 +0100
++++ wpasupplicant-0.6.4/debian/patches/series  2009-02-16 20:59:36.000000000 +0100
+@@ -1,6 +1,3 @@
+-01_use_pkg-config_for_pcsc-lite_module.patch
+ 02_dbus_group_policy.patch
+-03_dbus_service_activation_logfile.patch
+ 04_append_mmd_to_default_cflags.patch
+-05_qmake_version_makefile.patch
+ 06_fix_segfault_32bit_compat_ioctls.patch
+diff -rup wpasupplicant-0.6.4.orig/debian/rules wpasupplicant-0.6.4/debian/rules
+--- wpasupplicant-0.6.4.orig/debian/rules      2009-03-02 14:03:10.000000000 +0100
++++ wpasupplicant-0.6.4/debian/rules   2009-02-17 01:59:20.000000000 +0100
+@@ -1,12 +1,10 @@
+ #!/usr/bin/make -f
+ # Uncomment this to turn on verbose mode.
+-#export DH_VERBOSE=1
++export DH_VERBOSE=1
+ include /usr/share/quilt/quilt.make
+-WPAGUI = wpa_gui-qt4
+-
+ CFLAGS = -Wall -g
+ LDFLAGS = -Wl,--as-needed
+@@ -18,12 +16,7 @@ endif
+ DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
+-ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
+-      CONFIG := debian/config/kfreebsd
+-else
+-      CONFIG := debian/config/linux
+-endif
+-
++CONFIG := debian/config/linux
+ build: build-stamp
+ build-stamp: $(QUILT_STAMPFN)
+@@ -33,12 +26,6 @@ build-stamp: $(QUILT_STAMPFN)
+       cp -v $(CONFIG) wpa_supplicant/.config
+       CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) -C wpa_supplicant all
+       
+-      # wpa_gui
+-      $(MAKE) -C wpa_supplicant $(WPAGUI)
+-      
+-      # manpages
+-      $(MAKE) -C wpa_supplicant/doc/docbook man
+-      
+       touch $@
+ clean: unpatch
+@@ -46,12 +33,6 @@ clean: unpatch
+       
+       $(MAKE) -C wpa_supplicant clean
+       
+-      if [ -f wpa_supplicant/$(WPAGUI)/Makefile ]; then \
+-              $(MAKE) -C wpa_supplicant/$(WPAGUI) distclean ; \
+-      fi
+-      
+-      $(MAKE) -C wpa_supplicant/doc/docbook clean
+-      
+       dh_clean wpa_supplicant/.config build-stamp install-stamp
+ install: build
+@@ -61,15 +42,6 @@ install: build
+       dh_installdirs
+       dh_install
+       
+-      # wpa_gui
+-      dh_install --package=wpagui wpa_supplicant/$(WPAGUI)/wpa_gui usr/sbin/
+-      
+-      # ifupdown
+-      install --mode=755 -D debian/ifupdown/ifupdown.sh \
+-              debian/wpasupplicant/etc/wpa_supplicant/ifupdown.sh
+-      install --mode=755 -D debian/ifupdown/functions.sh \
+-              debian/wpasupplicant/etc/wpa_supplicant/functions.sh
+-      
+       # wpa_action
+       install --mode=755 -D debian/ifupdown/wpa_action.sh \
+               debian/wpasupplicant/sbin/wpa_action
+@@ -84,6 +56,12 @@ install: build
+       mkdir -p debian/wpasupplicant/usr/share/doc/wpasupplicant
+       sed 's/^\([^#]\+=.*\|}\)/#\1/' < wpa_supplicant/wpa_supplicant.conf \
+               > debian/wpasupplicant/usr/share/doc/wpasupplicant/README.wpa_supplicant.conf
++      
++      # Clean output a little
++      rm -rf debian/wpasupplicant/etc/network/if*
++      rm -rf debian/wpasupplicant/usr/share/doc
++      rm -rf debian/wpasupplicant/etc/init.d
++      
+ # Build architecture-independent files here.
+ binary-indep: install
+@@ -92,13 +70,6 @@ binary-indep: install
+ binary-arch: install
+       dh_testdir
+       dh_testroot
+-      dh_installchangelogs wpa_supplicant/ChangeLog
+-      dh_installdocs
+-      dh_installexamples
+-      dh_installlogrotate --package=wpasupplicant --name=wpa_action
+-      dh_installlogrotate --package=wpasupplicant --name=wpa_supplicant
+-      dh_installinit --package=wpasupplicant --name=wpa-ifupdown --no-start -- start 15 0 6 .
+-      dh_installman
+       dh_link
+       dh_strip
+       dh_compress
+diff -rup wpasupplicant-0.6.4.orig/debian/wpasupplicant.links wpasupplicant-0.6.4/debian/wpasupplicant.links
+--- wpasupplicant-0.6.4.orig/debian/wpasupplicant.links        2009-03-02 14:03:10.000000000 +0100
++++ wpasupplicant-0.6.4/debian/wpasupplicant.links     2009-02-17 01:54:34.000000000 +0100
+@@ -1,5 +1 @@
+-etc/wpa_supplicant/ifupdown.sh etc/network/if-pre-up.d/wpasupplicant
+-etc/wpa_supplicant/ifupdown.sh etc/network/if-up.d/wpasupplicant
+-etc/wpa_supplicant/ifupdown.sh etc/network/if-down.d/wpasupplicant
+-etc/wpa_supplicant/ifupdown.sh etc/network/if-post-down.d/wpasupplicant
+-usr/share/doc/wpasupplicant/README.Debian usr/share/doc/wpasupplicant/README.modes
++
+diff -rup wpasupplicant-0.6.4.orig/debian/wpasupplicant.postinst wpasupplicant-0.6.4/debian/wpasupplicant.postinst
+--- wpasupplicant-0.6.4.orig/debian/wpasupplicant.postinst     2009-03-02 14:03:10.000000000 +0100
++++ wpasupplicant-0.6.4/debian/wpasupplicant.postinst  2009-02-16 21:09:26.000000000 +0100
+@@ -17,10 +17,7 @@
+ case "$1" in
+       configure)
+-              # Add the netdev group unless it's already there
+-              if ! getent group netdev >/dev/null; then
+-                      addgroup --quiet --system netdev || true
+-              fi
++
+               ;;
+       abort-upgrade|abort-deconfigure|abort-remove)
+               ;;
+diff -rup wpasupplicant-0.6.4.orig/src/drivers/driver_wext.c wpasupplicant-0.6.4/src/drivers/driver_wext.c
+--- wpasupplicant-0.6.4.orig/src/drivers/driver_wext.c 2008-08-10 19:33:12.000000000 +0200
++++ wpasupplicant-0.6.4/src/drivers/driver_wext.c      2009-03-02 14:04:11.000000000 +0100
+@@ -628,6 +628,22 @@ static void wpa_driver_wext_event_wirele
+                       os_memcpy(&iwe_buf, pos, sizeof(struct iw_event));
+                       custom += IW_EV_POINT_OFF;
+               }
++              
++              if (iwe->cmd == IWEVASSOCREQIE || 
++                  iwe->cmd == IWEVASSOCRESPIE) {
++                      // Find and ignore bssid: put by the driver
++                      while (iwe->u.data.length > 0 && *custom != ':')
++                      {
++                              custom++;
++                              iwe->u.data.length--;
++                      }
++                      
++                      if (iwe->u.data.length > 0)
++                      {
++                              custom++;
++                              iwe->u.data.length--;
++                      }
++              }
+               switch (iwe->cmd) {
+               case SIOCGIWAP:
+@@ -1221,7 +1237,6 @@ int wpa_driver_wext_scan(void *priv, con
+       struct wpa_driver_wext_data *drv = priv;
+       struct iwreq iwr;
+       int ret = 0, timeout;
+-      struct iw_scan_req req;
+       if (ssid_len > IW_ESSID_MAX_SIZE) {
+               wpa_printf(MSG_DEBUG, "%s: too long SSID (%lu)",
+@@ -1233,14 +1248,13 @@ int wpa_driver_wext_scan(void *priv, con
+       os_strlcpy(iwr.ifr_name, drv->ifname, IFNAMSIZ);
+       if (ssid && ssid_len) {
+-              os_memset(&req, 0, sizeof(req));
+-              req.essid_len = ssid_len;
+-              req.bssid.sa_family = ARPHRD_ETHER;
+-              os_memset(req.bssid.sa_data, 0xff, ETH_ALEN);
+-              os_memcpy(req.essid, ssid, ssid_len);
+-              iwr.u.data.pointer = (caddr_t) &req;
+-              iwr.u.data.length = sizeof(req);
+-              iwr.u.data.flags = IW_SCAN_THIS_ESSID;
++              wpa_printf(MSG_DEBUG, "Scan requested (ret=%d) - scan timeout %d "
++                 "seconds", ret, timeout);
++              iwr.u.essid.pointer = (caddr_t) ssid;
++              iwr.u.essid.length = ssid_len;
++              iwr.u.essid.flags = IW_SCAN_THIS_ESSID;
++      } else {
++              iwr.u.essid.flags = IW_SCAN_ALL_ESSID;
+       }
+       if (ioctl(drv->ioctl_sock, SIOCSIWSCAN, &iwr) < 0) {
+diff -rup wpasupplicant-0.6.4.orig/wpa_supplicant/scan.c wpasupplicant-0.6.4/wpa_supplicant/scan.c
+--- wpasupplicant-0.6.4.orig/wpa_supplicant/scan.c     2008-08-10 19:33:12.000000000 +0200
++++ wpasupplicant-0.6.4/wpa_supplicant/scan.c  2009-02-20 13:25:51.000000000 +0100
+@@ -140,6 +140,7 @@ static void wpa_supplicant_scan(void *el
+               wpa_printf(MSG_DEBUG, "Trying to get current scan results "
+                          "first without requesting a new scan to speed up "
+                          "initial association");
++              wpa_s->prev_scan_ssid = BROADCAST_SSID_SCAN;
+               wpa_supplicant_event(wpa_s, EVENT_SCAN_RESULTS, NULL);
+               return;
+       }