mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-01-03 01:29:43 +00:00
- moved protocol removal to a proper function and fixed it
This commit is contained in:
parent
f087a2d3bc
commit
67017a2b2c
@ -84,6 +84,22 @@ static NetProtocol *find_protocol(uint16 type)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Remove all protocols
|
||||
*/
|
||||
|
||||
static void remove_all_protocols(void)
|
||||
{
|
||||
NetProtocol *p = prot_list;
|
||||
while (p) {
|
||||
NetProtocol *next = p->next;
|
||||
delete p;
|
||||
p = next;
|
||||
}
|
||||
prot_list = NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initialization
|
||||
*/
|
||||
@ -195,12 +211,7 @@ void EtherExit(void)
|
||||
close(fd);
|
||||
|
||||
// Remove all protocols
|
||||
NetProtocol *p = prot_list;
|
||||
while (p) {
|
||||
NetProtocol *next = p->next;
|
||||
delete p;
|
||||
p = next;
|
||||
}
|
||||
remove_all_protocols();
|
||||
}
|
||||
|
||||
|
||||
@ -210,13 +221,7 @@ void EtherExit(void)
|
||||
|
||||
void EtherReset(void)
|
||||
{
|
||||
// Remove all protocols
|
||||
NetProtocol *p = prot_list;
|
||||
while (p) {
|
||||
NetProtocol *next = p->next;
|
||||
delete p;
|
||||
p = next;
|
||||
}
|
||||
remove_all_protocols();
|
||||
}
|
||||
|
||||
|
||||
@ -283,7 +288,7 @@ int16 ether_detach_ph(uint16 type)
|
||||
if (p != NULL) {
|
||||
NetProtocol *q = prot_list;
|
||||
if (p == q) {
|
||||
prot_list = NULL;
|
||||
prot_list = p->next;
|
||||
delete p;
|
||||
return noErr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user