<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3627" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=894173420-21122009>I am running into the MLME-REPLAYFAILURE
issues with wpa_supplicant in adhoc mode with madwifi drivers.</SPAN></DIV>
<DIV><SPAN class=894173420-21122009></SPAN> </DIV>
<DIV><SPAN class=894173420-21122009>My configuration file looks like
</SPAN></DIV>
<DIV><SPAN class=894173420-21122009>#IBSS/ad-hoc network with
WPA-NONE/TKIP<BR>ctrl_interface=/var/run/wpa_supplicant<BR>ap_scan=2<BR>network={<BR>
ssid="AODV_TEST"<BR>#
scan_ssid=1<BR>
mode=1<BR>#
auth_alg=OPEN<BR>
frequency=2412<BR>
proto=WPA<BR>
key_mgmt=WPA-NONE<BR>
pairwise=CCMP<BR>
group=CCMP<BR>
psk="testing123"<BR>}<BR></SPAN></DIV>
<DIV><SPAN class=894173420-21122009>Test scenario: Start wpa_supplicant on A
(hosts) and node B (hosts). Test the communication between A and B. Now
disconnect B for 5 mins and restart wpa_supplicant on B. And you will start
seeing </SPAN></DIV>
<DIV><SPAN class=894173420-21122009>WEXT: Custom wireless event:
'MLME-REPLAYFAILURE.indication(keyid=0 unicast
addr=00:15:6d:64:ec:cd)'<BR>Ignore event for foreign ifindex 25<BR>RTM_NEWLINK:
operstate=1 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])<BR>Wireless event:
cmd=0x8c02 len=85<BR></SPAN></DIV>
<DIV><SPAN class=894173420-21122009>This goes on for some time and then the two
devices can talk together. This event is getting generated in ccmp_decap
function. After adding the following printf statement</SPAN></DIV>
<DIV><SPAN class=894173420-21122009></SPAN> </DIV>
<DIV><SPAN class=894173420-21122009>
<DIV
style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: #000000; FONT-STYLE: normal; FONT-FAMILY: 'Courier New'; BACKGROUND-COLOR: #ffffff; TEXT-DECORATION: none"><PRE><SPAN> </SPAN><SPAN style="FONT-WEIGHT: bolder; COLOR: #800080">if</SPAN><SPAN> (pn </SPAN><SPAN>&&</SPAN><SPAN> pn </SPAN><SPAN><=</SPAN><SPAN> k</SPAN><SPAN>-></SPAN><SPAN>wk_keyrsc</SPAN><SPAN style="COLOR: #800000">[</SPAN><SPAN>tid</SPAN><SPAN style="COLOR: #800000">]</SPAN><SPAN>) </SPAN><SPAN style="COLOR: #800000">{</SPAN>
<SPAN> </SPAN><SPAN style="COLOR: #008000; FONT-STYLE: italic">/*</SPAN>
<SPAN style="COLOR: #008000; FONT-STYLE: italic"> * Replay violation.</SPAN>
<SPAN style="COLOR: #008000; FONT-STYLE: italic"> */</SPAN>
<SPAN> </SPAN><SPAN style="FONT-WEIGHT: bolder">IEEE80211_DPRINTF</SPAN><SPAN>(ctx</SPAN><SPAN>-></SPAN><SPAN>cc_vap, IEEE80211_MSG_CRYPTO,</SPAN><SPAN style="COLOR: #008080">"%s: pn=%d tid=%d, QOS_HAS_SEQ=%s keysrc = %d \n"</SPAN><SPAN>,</SPAN>
<SPAN> __func__, pn,tid,</SPAN><SPAN style="FONT-WEIGHT: bolder">IEEE80211_QOS_HAS_SEQ</SPAN><SPAN>(wh) </SPAN><SPAN>?</SPAN><SPAN> </SPAN><SPAN style="COLOR: #008080">"TRUE"</SPAN><SPAN> </SPAN><SPAN>:</SPAN><SPAN> </SPAN><SPAN style="COLOR: #008080">"FALSE"</SPAN><SPAN>,k</SPAN><SPAN>-></SPAN><SPAN>wk_keyrsc</SPAN><SPAN style="COLOR: #800000">[</SPAN><SPAN>tid</SPAN><SPAN style="COLOR: #800000">]</SPAN><SPAN>)</SPAN><SPAN>;</SPAN>
<SPAN> </SPAN><SPAN style="FONT-WEIGHT: bolder">ieee80211_notify_replay_failure</SPAN><SPAN>(vap, wh, k, pn)</SPAN><SPAN>;</SPAN>
<SPAN> vap</SPAN><SPAN>-></SPAN><SPAN>iv_stats.is_rx_ccmpreplay</SPAN><SPAN>++;</SPAN>
<SPAN> </SPAN><SPAN style="FONT-WEIGHT: bolder; COLOR: #800080">return</SPAN><SPAN> </SPAN><SPAN style="COLOR: #000080">0</SPAN><SPAN>;</SPAN>
<SPAN> </SPAN><SPAN style="COLOR: #800000">}</SPAN>
</PRE></DIV></SPAN></DIV>
<DIV><SPAN class=894173420-21122009></SPAN><SPAN class=894173420-21122009>
<DIV
style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: #000000; FONT-STYLE: normal; FONT-FAMILY: 'Courier New'; BACKGROUND-COLOR: #ffffff; TEXT-DECORATION: none"><PRE><SPAN><SPAN class=894173420-21122009>I get the following log messages.</SPAN></SPAN></PRE></DIV></DIV></SPAN>
<DIV><SPAN class=894173420-21122009></SPAN><SPAN
class=894173420-21122009>wifi0/ath0[00:15:6d:64:ec:c0]: ccmp_decap: pn=45 tid=0,
QOS_HAS_SEQ=FALSE keysrc = 372<BR>wifi0/ath0[00:15:6d:64:ec:c0]:
00:15:6d:64:ec:d6 AES-CCM replay detected <keyix 0, rsc 45
><BR></SPAN></DIV>
<DIV><SPAN class=894173420-21122009>Can somebody please point me to what am I
missing here. </SPAN></DIV>
<DIV><SPAN class=894173420-21122009></SPAN> </DIV>
<DIV><SPAN class=894173420-21122009>Thanks,</SPAN></DIV>
<DIV><SPAN class=894173420-21122009>Jaideep</DIV></SPAN></BODY></HTML>