aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-01-24 01:49:23 +0000
committerFelix Fietkau <nbd@openwrt.org>2012-01-24 01:49:23 +0000
commit53c6db5ab43194c89cc7fe2d03dbd630c39bcfda (patch)
treeac95f43ca393bda15b6733484b69c099a2f358cf /package
parent9cf1d4e06e836d0a6270bb70f6aee5ba5c607f18 (diff)
downloadupstream-53c6db5ab43194c89cc7fe2d03dbd630c39bcfda.tar.gz
upstream-53c6db5ab43194c89cc7fe2d03dbd630c39bcfda.tar.bz2
upstream-53c6db5ab43194c89cc7fe2d03dbd630c39bcfda.zip
hostapd: merge an upstream workaround for broken clients sending the wrong wpa type (should fix #9561)
SVN-Revision: 29876
Diffstat (limited to 'package')
-rw-r--r--package/hostapd/patches/100-pending_work.patch18
-rw-r--r--package/hostapd/patches/560-disable_ctrl_iface_mib.patch4
-rw-r--r--package/hostapd/patches/740-group_key_timeout.patch2
3 files changed, 21 insertions, 3 deletions
diff --git a/package/hostapd/patches/100-pending_work.patch b/package/hostapd/patches/100-pending_work.patch
index d9824f3178..8b318190fd 100644
--- a/package/hostapd/patches/100-pending_work.patch
+++ b/package/hostapd/patches/100-pending_work.patch
@@ -160,3 +160,21 @@
if (bss != &drv->first_bss) {
struct i802_bss *tbss;
+--- a/src/ap/wpa_auth.c
++++ b/src/ap/wpa_auth.c
+@@ -776,7 +776,14 @@ void wpa_receive(struct wpa_authenticato
+ }
+
+ if (sm->wpa == WPA_VERSION_WPA2) {
+- if (key->type != EAPOL_KEY_TYPE_RSN) {
++ if (key->type == EAPOL_KEY_TYPE_WPA) {
++ /*
++ * Some deployed station implementations seem to send
++ * msg 4/4 with incorrect type value in WPA2 mode.
++ */
++ wpa_printf(MSG_DEBUG, "Workaround: Allow EAPOL-Key "
++ "with unexpected WPA type in RSN mode");
++ } else if (key->type != EAPOL_KEY_TYPE_RSN) {
+ wpa_printf(MSG_DEBUG, "Ignore EAPOL-Key with "
+ "unexpected type %d in RSN mode",
+ key->type);
diff --git a/package/hostapd/patches/560-disable_ctrl_iface_mib.patch b/package/hostapd/patches/560-disable_ctrl_iface_mib.patch
index 22f282ab5b..306c051178 100644
--- a/package/hostapd/patches/560-disable_ctrl_iface_mib.patch
+++ b/package/hostapd/patches/560-disable_ctrl_iface_mib.patch
@@ -123,7 +123,7 @@
struct sta_info *sta, int success)
--- a/src/ap/wpa_auth.c
+++ b/src/ap/wpa_auth.c
-@@ -2534,6 +2534,7 @@ static int wpa_cipher_bits(int cipher)
+@@ -2541,6 +2541,7 @@ static int wpa_cipher_bits(int cipher)
}
}
@@ -131,7 +131,7 @@
#define RSN_SUITE "%02x-%02x-%02x-%d"
#define RSN_SUITE_ARG(s) \
-@@ -2697,7 +2698,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
+@@ -2704,7 +2705,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
return len;
}
diff --git a/package/hostapd/patches/740-group_key_timeout.patch b/package/hostapd/patches/740-group_key_timeout.patch
index 694b0661fb..c1493952cd 100644
--- a/package/hostapd/patches/740-group_key_timeout.patch
+++ b/package/hostapd/patches/740-group_key_timeout.patch
@@ -1,6 +1,6 @@
--- a/src/ap/wpa_auth.c
+++ b/src/ap/wpa_auth.c
-@@ -1330,7 +1330,7 @@ static void wpa_send_eapol(struct wpa_au
+@@ -1337,7 +1337,7 @@ static void wpa_send_eapol(struct wpa_au
keyidx, encr, 0);
ctr = pairwise ? sm->TimeoutCtr : sm->GTimeoutCtr;
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578
/*
 * Copyright (C) 2009      Citrix Ltd.
 * Author Vincent Hanquez <vincent.hanquez@eu.citrix.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation; version 2.1 only. with the special
 * exception on linking described in file LICENSE.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 */

/*
 * libxl memory management
 *
 * From the point of view of the application (ie, libxl's caller),
 * struct libxl_ctx* is threadsafe, and all returned allocated
 * structures are obtained from malloc(), and must be freed by the
 * caller either directly or by calling an appropriate free function
 * provided by libxl.  Ie the application does not get automatic
 * assistance from libxl in managing these allocations.
 *
 * Specific details are in the header comments which should be found
 * in libxl.h or libxlutil.h, next to the relevant function
 * declarations.
 *
 * Internally, libxl has a garbage collection scheme which allows much libxl
 * code to allocate strings etc. for internal use without needing to
 * free them.  These are called "temporary allocations".
 *
 * The pool for these temporary allocations, along with any other
 * thread-specific data which is private to libxl but shared between
 * libxl functions (such as the current xenstore transaction), is
 * stored in the "gc context" which is a special enhanced context
 * structure allocated automatically by convenience macros at every
 * entry to libxl.
 *
 * Every libxl function falls into one of these categories:
 *
 * 1. Public functions (declared in libxl.h, libxlutil.h), which may
 *    be called by libxl applications.  If a public function returns
 *    any allocated object to its caller, that object must have come
 *    from malloc.
 *
 *    The definitions of public functions MUST use the gc context
 *    initialisation macros (or do the equivalent work themselves).
 *    These macros will ensure that all temporary allocations will be
 *    automatically freed before the function returns to its caller.
 *
 *    A public function may be called from within libxl; the call
 *    context initialisation macros will make sure that the internal
 *    caller's context is reused (eg, so that the same xenstore
 *    transaction is used).
 *
 *    Public functions have names like libxl_foobar.
 *
 * 2. Private functions, which may not be called by libxl
 *    applications; they are not declared in libxl.h or libxlutil.h
 *    and they may not be called other than by other libxl functions.
 *
 *    Private functions should not use the gc context initialisation
 *    macros.
 *
 *    Private functions have names like libxl__foobar (NB, two underscores).
 *    Also the declaration of such functions must be preceeded by the _hidden
 *    macro.
 *
 * Allocations made by a libxl function fall into one of the following
 * categories (where "object" includes any memory allocation):
 *
 * (a) Objects which are not returned to the function's caller.
 *     These should be allocated from the temporary pool.
 *
 * (b) Objects which are intended for return to the calling
 *     application.  This includes all allocated objects returned by
 *     any public function.
 *
 *     It may also include objects allocated by an internal function
 *     specifically for eventual return by the function's external
 *     callers, but this situation should be clearly documented in
 *     comments.
 *
 *     These should be allocated from malloc() et al. and comments
 *     near the function declaration should explain the memory
 *     ownership.  If a simple free() by the application is not
 *     sufficient, a suitable public freeing function should be
 *     provided.
 *
 * (c) Internal objects whose size and/or lifetime dictate explicit
 *     memory management within libxl.  This includes objects which
 *     will be embedded in opaque structures which will be returned to
 *     the libxl caller (more generally, any internal object whose
 *     lifetime exceeds the libxl entrypoint which creates it) and
 *     objects which are so large or numerous that explicit memory
 *     management is required.
 *
 *     These should be allocated from malloc() et al., and freed
 *     explicitly at the appropriate point.  The situation should be
 *     documented in comments.
 *
 * (d) Objects which are allocated by internal-only functions and
 *     returned to the function's (therefore, internal) caller but are
 *     strictly for internal use by other parts of libxl.  These
 *     should be allocated from the temporary pool.
 *
 *     Where a function's primary purpose is to return such an object,
 *     it should have a libxl__gc * as it's first argument.
 *
 *     Note that there are two ways to change an allocation from this
 *     category to the "public" category. Either the implementation
 *     is kept internal and a wrapper function duplicates all memory
 *     allocations so that they are suitable for return to external
 *     callers or the implementation uses plain malloc() et al calls
 *     and an internal wrapper adds the relevant pointers to the gc.
 *     The latter method is preferred for obvious performance reasons.
 *
 * No temporary objects allocated from the pool may be explicitly freed.
 * Therefore public functions which initialize a libxl__gc MUST call
 * libxl__free_all() before returning.
 */
#ifndef LIBXL_H
#define LIBXL_H

#include <stdbool.h>
#include <stdint.h>
#include <stdarg.h>
#include <errno.h>
#include <netinet/in.h>
#include <sys/wait.h> /* for pid_t */

#include <xentoollog.h>

#include <xen/sched.h>
#include <xen/sysctl.h>

#include <libxl_uuid.h>

typedef uint8_t libxl_mac[6];

typedef char **libxl_string_list;
void libxl_string_list_destroy(libxl_string_list *sl);

typedef char **libxl_key_value_list;
void libxl_key_value_list_destroy(libxl_key_value_list *kvl);

typedef uint32_t libxl_hwcap[8];

typedef struct {
    uint32_t size;          /* number of bytes in map */
    uint8_t *map;
} libxl_cpumap;
void libxl_cpumap_destroy(libxl_cpumap *map);

typedef struct {
    uint32_t entries;
    uint32_t *array;
} libxl_cpuarray;
#define LIBXL_CPUARRAY_INVALID_ENTRY  ~0
void libxl_cpuarray_destroy(libxl_cpuarray *array);

typedef enum {
    LIBXL_DOMAIN_TYPE_FV = 1,
    LIBXL_DOMAIN_TYPE_PV,
} libxl_domain_type;

typedef enum libxl_device_model_version {
    /* Historical qemu-xen device model (qemu-dm) */
    LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL = 1,
    /* Upstream based qemu-xen device model */
    LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN = 2,
} libxl_device_model_version;

typedef enum {
    LIBXL_CONSOLE_TYPE_SERIAL = 1,
    LIBXL_CONSOLE_TYPE_PV,
} libxl_console_type;

typedef enum {
    LIBXL_CONSOLE_BACKEND_XENCONSOLED,
    LIBXL_CONSOLE_BACKEND_IOEMU,
} libxl_console_backend;

typedef enum {
    LIBXL_DISK_FORMAT_UNKNOWN = 0,
    LIBXL_DISK_FORMAT_QCOW,
    LIBXL_DISK_FORMAT_QCOW2,
    LIBXL_DISK_FORMAT_VHD,
    LIBXL_DISK_FORMAT_RAW,
    LIBXL_DISK_FORMAT_EMPTY,
} libxl_disk_format;

typedef enum {
    LIBXL_DISK_BACKEND_UNKNOWN = 0,
    LIBXL_DISK_BACKEND_PHY,
    LIBXL_DISK_BACKEND_TAP,
    LIBXL_DISK_BACKEND_QDISK,
} libxl_disk_backend;

typedef enum {
    LIBXL_NIC_TYPE_IOEMU = 1,
    LIBXL_NIC_TYPE_VIF,
} libxl_nic_type;

typedef struct {
    /*
     * Path is always set if the file reference is valid. However if
     * mapped is true then the actual file may already be unlinked.
     */
    char * path;
    int mapped;
    void * data;
    size_t size;
} libxl_file_reference;
void libxl_file_reference_destroy(libxl_file_reference *p);

/* libxl_cpuid_policy_list is a dynamic array storing CPUID policies
 * for multiple leafs. It is terminated with an entry holding
 * XEN_CPUID_INPUT_UNUSED in input[0]
 */
typedef struct libxl__cpuid_policy libxl_cpuid_policy;
typedef libxl_cpuid_policy * libxl_cpuid_policy_list;
void libxl_cpuid_destroy(libxl_cpuid_policy_list *cpuid_list);

#define LIBXL_PCI_FUNC_ALL (~0U)

#include "_libxl_types.h"

typedef struct libxl__ctx libxl_ctx;

const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx);

typedef struct {
#define XL_SUSPEND_DEBUG 1
#define XL_SUSPEND_LIVE 2
    int flags;
    int (*suspend_callback)(void *, int);
} libxl_domain_suspend_info;

enum {
    ERROR_NONSPECIFIC = -1,
    ERROR_VERSION = -2,
    ERROR_FAIL = -3,
    ERROR_NI = -4,
    ERROR_NOMEM = -5,
    ERROR_INVAL = -6,
    ERROR_BADFAIL = -7,