git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Kernel/x86 - Oops, bad entry
[tpg/acess2.git]
/
Modules
/
IPStack
/
udp.c
diff --git
a/Modules/IPStack/udp.c
b/Modules/IPStack/udp.c
index
1fce3ac
..
c75aab0
100644
(file)
--- a/
Modules/IPStack/udp.c
+++ b/
Modules/IPStack/udp.c
@@
-3,7
+3,7
@@
* - UDP Handling
*/
#include "ipstack.h"
* - UDP Handling
*/
#include "ipstack.h"
-#include <
tpl
_drv_common.h>
+#include <
api
_drv_common.h>
#include "udp.h"
#define UDP_ALLOC_BASE 0xC000
#include "udp.h"
#define UDP_ALLOC_BASE 0xC000
@@
-70,7
+70,8
@@
int UDP_int_ScanList(tUDPChannel *List, tInterface *Interface, void *Address, in
// Check for remote address restriction
if(chan->RemoteMask)
{
// Check for remote address restriction
if(chan->RemoteMask)
{
- if(chan->Remote.AddrType != Interface->Type) continue;
+ if(chan->Remote.AddrType != Interface->Type)
+ continue;
if(!IPStack_CompareAddress(Interface->Type, Address,
&chan->Remote.Addr, chan->RemoteMask)
)
if(!IPStack_CompareAddress(Interface->Type, Address,
&chan->Remote.Addr, chan->RemoteMask)
)
@@
-94,6
+95,7
@@
int UDP_int_ScanList(tUDPChannel *List, tInterface *Interface, void *Address, in
else
chan->QueueEnd = chan->Queue = pack;
SHORTREL(&chan->lQueue);
else
chan->QueueEnd = chan->Queue = pack;
SHORTREL(&chan->lQueue);
+ VFS_MarkAvaliable(&chan->Node, 1);
Mutex_Release(&glUDP_Channels);
return 1;
}
Mutex_Release(&glUDP_Channels);
return 1;
}
@@
-190,7
+192,10
@@
Uint64 UDP_Channel_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buf
tUDPEndpoint *ep;
int ofs;
tUDPEndpoint *ep;
int ofs;
- if(chan->LocalPort == 0) return 0;
+ if(chan->LocalPort == 0) {
+ Log_Notice("UDP", "Channel %p sent with no local port", chan);
+ return 0;
+ }
while(chan->Queue == NULL) Threads_Yield();
while(chan->Queue == NULL) Threads_Yield();
@@
-217,6
+222,7
@@
Uint64 UDP_Channel_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buf
ofs = 4 + IPStack_GetAddressSize(pack->Remote.AddrType);
if(Length < ofs) {
free(pack);
ofs = 4 + IPStack_GetAddressSize(pack->Remote.AddrType);
if(Length < ofs) {
free(pack);
+ Log_Notice("UDP", "Insuficient space for header in buffer (%i < %i)", (int)Length, ofs);
return 0;
}
return 0;
}
@@
-251,7
+257,7
@@
Uint64 UDP_Channel_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Bu
data = (char*)Buffer + ofs;
data = (char*)Buffer + ofs;
- UDP_SendPacketTo(chan, ep->AddrType, &ep->Addr, ep->Port,
Buffer
, (size_t)Length - ofs);
+ UDP_SendPacketTo(chan, ep->AddrType, &ep->Addr, ep->Port,
data
, (size_t)Length - ofs);
return 0;
}
return 0;
}
UCC
git Repository :: git.ucc.asn.au