wext-compat.c (aa129bcd34b6de2c37b5145da54a57901d5195bc) wext-compat.c (e7a7b84e33178db4a839c5e1773247be17597c1f)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * cfg80211 - wext compat code
4 *
5 * This is temporary code until all wireless functionality is migrated
6 * into cfg80211, when that happens all the exports here go away and
7 * we directly assign the wireless handlers of wireless interfaces.
8 *

--- 456 unchanged lines hidden (view full) ---

465 __cfg80211_leave_ibss(rdev, wdev->netdev, true);
466 rejoin = true;
467 }
468
469 if (!pairwise && addr &&
470 !(rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN))
471 err = -ENOENT;
472 else
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * cfg80211 - wext compat code
4 *
5 * This is temporary code until all wireless functionality is migrated
6 * into cfg80211, when that happens all the exports here go away and
7 * we directly assign the wireless handlers of wireless interfaces.
8 *

--- 456 unchanged lines hidden (view full) ---

465 __cfg80211_leave_ibss(rdev, wdev->netdev, true);
466 rejoin = true;
467 }
468
469 if (!pairwise && addr &&
470 !(rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN))
471 err = -ENOENT;
472 else
473 err = rdev_del_key(rdev, dev, idx, pairwise,
473 err = rdev_del_key(rdev, dev, -1, idx, pairwise,
474 addr);
475 }
476 wdev->wext.connect.privacy = false;
477 /*
478 * Applications using wireless extensions expect to be
479 * able to delete keys that don't exist, so allow that.
480 */
481 if (err == -ENOENT)

--- 22 unchanged lines hidden (view full) ---

504
505 if (cfg80211_validate_key_settings(rdev, params, idx, pairwise, addr))
506 return -EINVAL;
507
508 err = 0;
509 if (wdev->connected ||
510 (wdev->iftype == NL80211_IFTYPE_ADHOC &&
511 wdev->u.ibss.current_bss))
474 addr);
475 }
476 wdev->wext.connect.privacy = false;
477 /*
478 * Applications using wireless extensions expect to be
479 * able to delete keys that don't exist, so allow that.
480 */
481 if (err == -ENOENT)

--- 22 unchanged lines hidden (view full) ---

504
505 if (cfg80211_validate_key_settings(rdev, params, idx, pairwise, addr))
506 return -EINVAL;
507
508 err = 0;
509 if (wdev->connected ||
510 (wdev->iftype == NL80211_IFTYPE_ADHOC &&
511 wdev->u.ibss.current_bss))
512 err = rdev_add_key(rdev, dev, idx, pairwise, addr, params);
512 err = rdev_add_key(rdev, dev, -1, idx, pairwise, addr, params);
513 else if (params->cipher != WLAN_CIPHER_SUITE_WEP40 &&
514 params->cipher != WLAN_CIPHER_SUITE_WEP104)
515 return -EINVAL;
516 if (err)
517 return err;
518
519 /*
520 * We only need to store WEP keys, since they're the only keys that

--- 20 unchanged lines hidden (view full) ---

541 * had one before we need to join a new IBSS with
542 * the privacy bit set.
543 */
544 if (wdev->iftype == NL80211_IFTYPE_ADHOC &&
545 wdev->wext.default_key == -1) {
546 __cfg80211_leave_ibss(rdev, wdev->netdev, true);
547 rejoin = true;
548 }
513 else if (params->cipher != WLAN_CIPHER_SUITE_WEP40 &&
514 params->cipher != WLAN_CIPHER_SUITE_WEP104)
515 return -EINVAL;
516 if (err)
517 return err;
518
519 /*
520 * We only need to store WEP keys, since they're the only keys that

--- 20 unchanged lines hidden (view full) ---

541 * had one before we need to join a new IBSS with
542 * the privacy bit set.
543 */
544 if (wdev->iftype == NL80211_IFTYPE_ADHOC &&
545 wdev->wext.default_key == -1) {
546 __cfg80211_leave_ibss(rdev, wdev->netdev, true);
547 rejoin = true;
548 }
549 err = rdev_set_default_key(rdev, dev, idx, true, true);
549 err = rdev_set_default_key(rdev, dev, -1, idx, true,
550 true);
550 }
551 if (!err) {
552 wdev->wext.default_key = idx;
553 if (rejoin)
554 err = cfg80211_ibss_wext_join(rdev, wdev);
555 }
556 return err;
557 }
558
559 if (params->cipher == WLAN_CIPHER_SUITE_AES_CMAC &&
560 (tx_key || (!addr && wdev->wext.default_mgmt_key == -1))) {
561 if (wdev->connected ||
562 (wdev->iftype == NL80211_IFTYPE_ADHOC &&
563 wdev->u.ibss.current_bss))
551 }
552 if (!err) {
553 wdev->wext.default_key = idx;
554 if (rejoin)
555 err = cfg80211_ibss_wext_join(rdev, wdev);
556 }
557 return err;
558 }
559
560 if (params->cipher == WLAN_CIPHER_SUITE_AES_CMAC &&
561 (tx_key || (!addr && wdev->wext.default_mgmt_key == -1))) {
562 if (wdev->connected ||
563 (wdev->iftype == NL80211_IFTYPE_ADHOC &&
564 wdev->u.ibss.current_bss))
564 err = rdev_set_default_mgmt_key(rdev, dev, idx);
565 err = rdev_set_default_mgmt_key(rdev, dev, -1, idx);
565 if (!err)
566 wdev->wext.default_mgmt_key = idx;
567 return err;
568 }
569
570 return 0;
571}
572

--- 54 unchanged lines hidden (view full) ---

627 remove = true;
628 else if (erq->length == 0) {
629 /* No key data - just set the default TX key index */
630 err = 0;
631 wdev_lock(wdev);
632 if (wdev->connected ||
633 (wdev->iftype == NL80211_IFTYPE_ADHOC &&
634 wdev->u.ibss.current_bss))
566 if (!err)
567 wdev->wext.default_mgmt_key = idx;
568 return err;
569 }
570
571 return 0;
572}
573

--- 54 unchanged lines hidden (view full) ---

628 remove = true;
629 else if (erq->length == 0) {
630 /* No key data - just set the default TX key index */
631 err = 0;
632 wdev_lock(wdev);
633 if (wdev->connected ||
634 (wdev->iftype == NL80211_IFTYPE_ADHOC &&
635 wdev->u.ibss.current_bss))
635 err = rdev_set_default_key(rdev, dev, idx, true,
636 err = rdev_set_default_key(rdev, dev, -1, idx, true,
636 true);
637 if (!err)
638 wdev->wext.default_key = idx;
639 wdev_unlock(wdev);
640 goto out;
641 }
642
643 memset(&params, 0, sizeof(params));

--- 1021 unchanged lines hidden ---
637 true);
638 if (!err)
639 wdev->wext.default_key = idx;
640 wdev_unlock(wdev);
641 goto out;
642 }
643
644 memset(&params, 0, sizeof(params));

--- 1021 unchanged lines hidden ---