refresh all package patches in the buildroot using quilt
[openwrt.git] / package / madwifi / patches / 123-ccmp_checks.patch
1 Index: madwifi-ng-r2420-20070602/net80211/ieee80211_crypto_ccmp.c
2 ===================================================================
3 --- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_crypto_ccmp.c     2007-06-04 13:21:53.234883736 +0200
4 +++ madwifi-ng-r2420-20070602/net80211/ieee80211_crypto_ccmp.c  2007-06-04 13:21:57.936169032 +0200
5 @@ -118,6 +118,12 @@
6         ctx->cc_ic = vap->iv_ic;
7         ctx->cc_tfm = crypto_alloc_cipher("aes", 0,
8                                         CRYPTO_ALG_ASYNC);
9 +       
10 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
11 +       if (IS_ERR(ctx->cc_tfm))
12 +               ctx->cc_tfm = NULL;
13 +#endif
14 +
15         if (ctx->cc_tfm == NULL) {
16                 IEEE80211_DPRINTF(vap, IEEE80211_MSG_CRYPTO,
17                                 "%s: unable to load kernel AES crypto support\n",
18 @@ -465,6 +471,9 @@
19         uint8_t *mic, *pos;
20         u_int space;
21  
22 +       if (ctx->cc_tfm == NULL)
23 +               return 0;
24 +
25         ctx->cc_vap->iv_stats.is_crypto_ccmp++;
26  
27         skb = skb0;
28 @@ -579,6 +588,9 @@
29         uint8_t *pos, *mic;
30         u_int space;
31  
32 +       if (ctx->cc_tfm == NULL)
33 +               return 0;
34 +
35         ctx->cc_vap->iv_stats.is_crypto_ccmp++;
36  
37         skb = skb0;