ns2出现Client: Handoff Attempt的情况解决

时间:2022-02-26 14:55:31

找到mac/mac-802_11.cc,这是系统本身一个bug,对于adhoc网络无需进行切换尝试。

> if (*rcount == 3 && handoff == 0) {
> //start handoff process
> printf("Client %d: Handoff Attempted\n",index_);
> associated = 0;
> authenticated = 0;
> handoff = 1;
> ScanType_ = ACTIVE;
> sendPROBEREQ(MAC_BROADCAST);
> return;
> }
改为
> if (infra_mode_ && *rcount == 3 && handoff == 0) {
> //start handoff process
> printf("Client %d: Handoff Attempted\n",index_);
> associated = 0;
> authenticated = 0;
> handoff = 1;
> ScanType_ = ACTIVE;
> sendPROBEREQ(MAC_BROADCAST);
> return;
> }