case 4: // Append IPv4 Pseudo Header
buflen = 4 + 4 + 4 + ((Length+1)&~1);
buf = malloc( buflen );
- buf[0] = Conn->Interface->IP4.Address.L;
+ buf[0] = ((tIPv4*)Conn->Interface->Address)->L;
buf[1] = Conn->RemoteIP.v4.L;
buf[2] = (htons(Length)<<16) | (6<<8) | 0;
Data->Checksum = 0;
memcpy( &buf[3], Data, Length );
- Data->Checksum = IPv4_Checksum( buf, buflen );
+ Data->Checksum = htons( IPv4_Checksum( buf, buflen ) );
free(buf);
IPv4_SendPacket(Conn->Interface, Conn->RemoteIP.v4, IP4PROT_TCP, 0, Length, Data);
break;
srv->ConnectionsTail = conn;
if(!srv->NewConnections)
srv->NewConnections = conn;
- SHORTLOCK(&srv->lConnections);
+ SHORTREL(&srv->lConnections);
// Send the SYN ACK
hdr->Flags |= TCP_FLAG_ACK;