Remove zeromus' stupid sabotaging. Completely block WFC.
This commit is contained in:
parent
e72cf1b901
commit
e40600564f
|
@ -741,8 +741,8 @@ INLINE void WIFI_MakeRXHeader(u8* buf, u16 flags, u16 xferRate, u16 len, u8 maxR
|
||||||
|
|
||||||
*(u16*)&buf[8] = len;
|
*(u16*)&buf[8] = len;
|
||||||
|
|
||||||
buf[10] = maxRSSI;
|
buf[10] = 253;//maxRSSI;
|
||||||
buf[11] = minRSSI;
|
buf[11] = 255;//minRSSI;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_WIFI_COMM
|
#ifdef EXPERIMENTAL_WIFI_COMM
|
||||||
|
@ -2027,8 +2027,6 @@ static bool SoftAP_IsDNSRequestToWFC(u16 ethertype, u8* body)
|
||||||
strcat(domainname, ".");
|
strcat(domainname, ".");
|
||||||
}
|
}
|
||||||
|
|
||||||
WIFI_LOG(1, "SoftAP: detected DNS request to %s\n", domainname);
|
|
||||||
|
|
||||||
// if the domain name contains nintendowifi.net
|
// if the domain name contains nintendowifi.net
|
||||||
// it is most likely a WFC server
|
// it is most likely a WFC server
|
||||||
// (note, conntest.nintendowifi.net just contains a dummy HTML page and
|
// (note, conntest.nintendowifi.net just contains a dummy HTML page and
|
||||||
|
@ -2166,21 +2164,11 @@ void SoftAP_SendPacket(u8 *packet, u32 len)
|
||||||
if (SoftAP.status != APStatus_Associated)
|
if (SoftAP.status != APStatus_Associated)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!bWFCUserWarned && SoftAP_IsDNSRequestToWFC(*(u16*)&packet[30], &packet[32]))
|
if (SoftAP_IsDNSRequestToWFC(*(u16*)&packet[30], &packet[32]))
|
||||||
{
|
|
||||||
// if the user chose not to connect to WFC
|
|
||||||
// disconnect them, and do not send the DNS packet
|
|
||||||
// otherwise just stop bothering them
|
|
||||||
if (driver->WIFI_WFCWarning())
|
|
||||||
{
|
|
||||||
bWFCUserWarned = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
SoftAP_Deauthenticate();
|
SoftAP_Deauthenticate();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
u32 epacketLen = ((len - 30 - 4) + 14);
|
u32 epacketLen = ((len - 30 - 4) + 14);
|
||||||
u8 epacket[2048];
|
u8 epacket[2048];
|
||||||
|
@ -2245,6 +2233,11 @@ static void SoftAP_RXHandler(u_char* user, const struct pcap_pkthdr* h, const u_
|
||||||
if (WIFI_compareMAC(&data[6], wifiMac.mac.bytes))
|
if (WIFI_compareMAC(&data[6], wifiMac.mac.bytes))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (SoftAP.curPacketSending)
|
||||||
|
{
|
||||||
|
printf("crap we're gonna nuke a packet at %i/%i (%04X) (%04X)\n", SoftAP.curPacketPos, SoftAP.curPacketSize, *(u16*)&SoftAP.curPacket[12], wifiMac.RXWriteCursor<<1);
|
||||||
|
}
|
||||||
|
|
||||||
// The packet was for us. Let's process it then.
|
// The packet was for us. Let's process it then.
|
||||||
WIFI_triggerIRQ(WIFI_IRQ_RXSTART);
|
WIFI_triggerIRQ(WIFI_IRQ_RXSTART);
|
||||||
|
|
||||||
|
@ -2296,7 +2289,7 @@ void SoftAP_usTrigger()
|
||||||
// other packets will have priority over beacons
|
// other packets will have priority over beacons
|
||||||
// 'cause they might be only once of them
|
// 'cause they might be only once of them
|
||||||
// whereas there will be sooo much beacons
|
// whereas there will be sooo much beacons
|
||||||
if(!SoftAP.curPacketSending)
|
if(!SoftAP.curPacketSending) // && SoftAP.status != APStatus_Associated)
|
||||||
{
|
{
|
||||||
//if(wifiMac.ioMem[0xD0 >> 1] & 0x0400)
|
//if(wifiMac.ioMem[0xD0 >> 1] & 0x0400)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2241,7 +2241,7 @@ class WinDriver : public BaseDriver
|
||||||
return _pcap_setnonblock(dev, nonblock, errbuf); }
|
return _pcap_setnonblock(dev, nonblock, errbuf); }
|
||||||
|
|
||||||
virtual int PCAP_sendpacket(pcap_t* dev, const u_char* data, int len) {
|
virtual int PCAP_sendpacket(pcap_t* dev, const u_char* data, int len) {
|
||||||
return _pcap_send(dev, data, len); }
|
return _pcap_sendpacket(dev, data, len); }
|
||||||
|
|
||||||
virtual int PCAP_dispatch(pcap_t* dev, int num, pcap_handler callback, u_char* userdata) {
|
virtual int PCAP_dispatch(pcap_t* dev, int num, pcap_handler callback, u_char* userdata) {
|
||||||
return _pcap_dispatch(dev, num, callback, userdata); }
|
return _pcap_dispatch(dev, num, callback, userdata); }
|
||||||
|
@ -2864,7 +2864,6 @@ int _main()
|
||||||
|
|
||||||
MainWindow->Show(SW_NORMAL);
|
MainWindow->Show(SW_NORMAL);
|
||||||
|
|
||||||
|
|
||||||
//DEBUG TEST HACK
|
//DEBUG TEST HACK
|
||||||
//driver->VIEW3D_Init();
|
//driver->VIEW3D_Init();
|
||||||
//driver->view3d->Launch();
|
//driver->view3d->Launch();
|
||||||
|
|
|
@ -34,7 +34,7 @@ typedef void (__cdecl *T_pcap_freealldevs)(pcap_if_t* alldevs);
|
||||||
typedef pcap_t* (__cdecl *T_pcap_open_live)(const char* source, int snaplen, int flags, int readtimeout, char* errbuf);
|
typedef pcap_t* (__cdecl *T_pcap_open_live)(const char* source, int snaplen, int flags, int readtimeout, char* errbuf);
|
||||||
typedef void (__cdecl *T_pcap_close)(pcap_t* dev);
|
typedef void (__cdecl *T_pcap_close)(pcap_t* dev);
|
||||||
typedef int (__cdecl *T_pcap_setnonblock)(pcap_t* dev, int nonblock, char* errbuf);
|
typedef int (__cdecl *T_pcap_setnonblock)(pcap_t* dev, int nonblock, char* errbuf);
|
||||||
typedef int (__cdecl *T_pcap_send)(pcap_t* dev, const u_char* data, int len);
|
typedef int (__cdecl *T_pcap_sendpacket)(pcap_t* dev, const u_char* data, int len);
|
||||||
typedef int (__cdecl *T_pcap_dispatch)(pcap_t* dev, int num, pcap_handler callback, u_char* userdata);
|
typedef int (__cdecl *T_pcap_dispatch)(pcap_t* dev, int num, pcap_handler callback, u_char* userdata);
|
||||||
|
|
||||||
T_pcap_findalldevs _pcap_findalldevs = NULL;
|
T_pcap_findalldevs _pcap_findalldevs = NULL;
|
||||||
|
@ -42,7 +42,7 @@ T_pcap_freealldevs _pcap_freealldevs = NULL;
|
||||||
T_pcap_open_live _pcap_open_live = NULL;
|
T_pcap_open_live _pcap_open_live = NULL;
|
||||||
T_pcap_close _pcap_close = NULL;
|
T_pcap_close _pcap_close = NULL;
|
||||||
T_pcap_setnonblock _pcap_setnonblock = NULL;
|
T_pcap_setnonblock _pcap_setnonblock = NULL;
|
||||||
T_pcap_send _pcap_send = NULL;
|
T_pcap_sendpacket _pcap_sendpacket = NULL;
|
||||||
T_pcap_dispatch _pcap_dispatch = NULL;
|
T_pcap_dispatch _pcap_dispatch = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ static void LoadWinPCap()
|
||||||
LOADSYMBOL(pcap_open_live);
|
LOADSYMBOL(pcap_open_live);
|
||||||
LOADSYMBOL(pcap_close);
|
LOADSYMBOL(pcap_close);
|
||||||
LOADSYMBOL(pcap_setnonblock);
|
LOADSYMBOL(pcap_setnonblock);
|
||||||
LOADSYMBOL(pcap_send);
|
LOADSYMBOL(pcap_sendpacket);
|
||||||
LOADSYMBOL(pcap_dispatch);
|
LOADSYMBOL(pcap_dispatch);
|
||||||
|
|
||||||
bWinPCapAvailable = true;
|
bWinPCapAvailable = true;
|
||||||
|
|
Loading…
Reference in New Issue