Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=50339a67e2d4386d8919195989371579cab8649d
Commit:     50339a67e2d4386d8919195989371579cab8649d
Parent:     2a8a9a88fc1b18f5c45244d0ef8a5352f6cf761f
Author:     Johannes Berg <[EMAIL PROTECTED]>
AuthorDate: Tue Aug 28 17:01:52 2007 -0400
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 16:48:40 2007 -0700

    [MAC80211]: fix key debugfs
    
    This fixes two issues with the key debugfs:
     1) key index obviously isn't unique
     2) various missing break statements led to bogus output
    
    Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>
    Acked-by: Michael Wu <[EMAIL PROTECTED]>
    Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/mac80211/debugfs_key.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/debugfs_key.c b/net/mac80211/debugfs_key.c
index 7d56dc9..077f907 100644
--- a/net/mac80211/debugfs_key.c
+++ b/net/mac80211/debugfs_key.c
@@ -77,14 +77,17 @@ static ssize_t key_tx_spec_read(struct file *file, char 
__user *userbuf,
        switch (key->alg) {
        case ALG_WEP:
                len = scnprintf(buf, sizeof(buf), "\n");
+               break;
        case ALG_TKIP:
                len = scnprintf(buf, sizeof(buf), "%08x %04x\n",
                                key->u.tkip.iv32,
                                key->u.tkip.iv16);
+               break;
        case ALG_CCMP:
                tpn = key->u.ccmp.tx_pn;
                len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n",
                                tpn[0], tpn[1], tpn[2], tpn[3], tpn[4], tpn[5]);
+               break;
        default:
                return 0;
        }
@@ -103,6 +106,7 @@ static ssize_t key_rx_spec_read(struct file *file, char 
__user *userbuf,
        switch (key->alg) {
        case ALG_WEP:
                len = scnprintf(buf, sizeof(buf), "\n");
+               break;
        case ALG_TKIP:
                for (i = 0; i < NUM_RX_DATA_QUEUES; i++)
                        p += scnprintf(p, sizeof(buf)+buf-p,
@@ -110,6 +114,7 @@ static ssize_t key_rx_spec_read(struct file *file, char 
__user *userbuf,
                                       key->u.tkip.iv32_rx[i],
                                       key->u.tkip.iv16_rx[i]);
                len = p - buf;
+               break;
        case ALG_CCMP:
                for (i = 0; i < NUM_RX_DATA_QUEUES; i++) {
                        rpn = key->u.ccmp.rx_pn[i];
@@ -119,6 +124,7 @@ static ssize_t key_rx_spec_read(struct file *file, char 
__user *userbuf,
                                       rpn[3], rpn[4], rpn[5]);
                }
                len = p - buf;
+               break;
        default:
                return 0;
        }
@@ -164,12 +170,14 @@ KEY_OPS(key);
 void ieee80211_debugfs_key_add(struct ieee80211_local *local,
                               struct ieee80211_key *key)
 {
+       static int keycount;
        char buf[20];
 
        if (!local->debugfs.keys)
                return;
 
-       sprintf(buf, "%d", key->keyidx);
+       sprintf(buf, "%d", keycount);
+       keycount++;
        key->debugfs.dir = debugfs_create_dir(buf,
                                        local->debugfs.keys);
 
@@ -239,7 +247,7 @@ void ieee80211_debugfs_key_sta_link(struct ieee80211_key 
*key,
        if (!key->debugfs.dir)
                return;
 
-       sprintf(buf, "../sta/" MAC_FMT, MAC_ARG(sta->addr));
+       sprintf(buf, "../../stations/" MAC_FMT, MAC_ARG(sta->addr));
        key->debugfs.stalink =
                debugfs_create_symlink("station", key->debugfs.dir, buf);
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to