]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/ieee80211/ieee80211_crypt_tkip.c
net: convert print_mac to %pM
[mirror_ubuntu-bionic-kernel.git] / net / ieee80211 / ieee80211_crypt_tkip.c
index bba0152e2d713b5798e6501711312e59a4267cef..d12da1da6328bd3810803fe66af1f0ee48b307b5 100644 (file)
@@ -359,15 +359,13 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
        u8 rc4key[16], *pos, *icv;
        u32 crc;
        struct scatterlist sg;
-       DECLARE_MAC_BUF(mac);
 
        if (tkey->flags & IEEE80211_CRYPTO_TKIP_COUNTERMEASURES) {
                if (net_ratelimit()) {
                        struct ieee80211_hdr_4addr *hdr =
                            (struct ieee80211_hdr_4addr *)skb->data;
                        printk(KERN_DEBUG ": TKIP countermeasures: dropped "
-                              "TX packet to %s\n",
-                              print_mac(mac, hdr->addr1));
+                              "TX packet to %pM\n", hdr->addr1);
                }
                return -1;
        }
@@ -420,15 +418,13 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
        u32 crc;
        struct scatterlist sg;
        int plen;
-       DECLARE_MAC_BUF(mac);
 
        hdr = (struct ieee80211_hdr_4addr *)skb->data;
 
        if (tkey->flags & IEEE80211_CRYPTO_TKIP_COUNTERMEASURES) {
                if (net_ratelimit()) {
                        printk(KERN_DEBUG ": TKIP countermeasures: dropped "
-                              "received packet from %s\n",
-                              print_mac(mac, hdr->addr2));
+                              "received packet from %pM\n", hdr->addr2);
                }
                return -1;
        }
@@ -441,7 +437,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
        if (!(keyidx & (1 << 5))) {
                if (net_ratelimit()) {
                        printk(KERN_DEBUG "TKIP: received packet without ExtIV"
-                              " flag from %s\n", print_mac(mac, hdr->addr2));
+                              " flag from %pM\n", hdr->addr2);
                }
                return -2;
        }
@@ -453,9 +449,9 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
        }
        if (!tkey->key_set) {
                if (net_ratelimit()) {
-                       printk(KERN_DEBUG "TKIP: received packet from %s"
+                       printk(KERN_DEBUG "TKIP: received packet from %pM"
                               " with keyid=%d that does not have a configured"
-                              " key\n", print_mac(mac, hdr->addr2), keyidx);
+                              " key\n", hdr->addr2, keyidx);
                }
                return -3;
        }
@@ -465,9 +461,9 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
 
        if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) {
                if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) {
-                       IEEE80211_DEBUG_DROP("TKIP: replay detected: STA=%s"
+                       IEEE80211_DEBUG_DROP("TKIP: replay detected: STA=%pM"
                               " previous TSC %08x%04x received TSC "
-                              "%08x%04x\n", print_mac(mac, hdr->addr2),
+                              "%08x%04x\n", hdr->addr2,
                               tkey->rx_iv32, tkey->rx_iv16, iv32, iv16);
                }
                tkey->dot11RSNAStatsTKIPReplays++;
@@ -487,8 +483,8 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
        if (crypto_blkcipher_decrypt(&desc, &sg, &sg, plen + 4)) {
                if (net_ratelimit()) {
                        printk(KERN_DEBUG ": TKIP: failed to decrypt "
-                              "received packet from %s\n",
-                              print_mac(mac, hdr->addr2));
+                              "received packet from %pM\n",
+                              hdr->addr2);
                }
                return -7;
        }
@@ -506,7 +502,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
                }
                if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) {
                        IEEE80211_DEBUG_DROP("TKIP: ICV error detected: STA="
-                              "%s\n", print_mac(mac, hdr->addr2));
+                              "%pM\n", hdr->addr2);
                }
                tkey->dot11RSNAStatsTKIPICVErrors++;
                return -5;
@@ -633,7 +629,6 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx,
 {
        struct ieee80211_tkip_data *tkey = priv;
        u8 mic[8];
-       DECLARE_MAC_BUF(mac);
 
        if (!tkey->key_set)
                return -1;
@@ -646,8 +641,8 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx,
                struct ieee80211_hdr_4addr *hdr;
                hdr = (struct ieee80211_hdr_4addr *)skb->data;
                printk(KERN_DEBUG "%s: Michael MIC verification failed for "
-                      "MSDU from %s keyidx=%d\n",
-                      skb->dev ? skb->dev->name : "N/A", print_mac(mac, hdr->addr2),
+                      "MSDU from %pM keyidx=%d\n",
+                      skb->dev ? skb->dev->name : "N/A", hdr->addr2,
                       keyidx);
                if (skb->dev)
                        ieee80211_michael_mic_failure(skb->dev, hdr, keyidx);