uint16 *ip_addr = ip;
uint16 *tcp_addr = tcp;
- if (session.debug == SESSION_DEBUG_HIGH) {
+ if (session.debug >= SESSION_DEBUG_HIGH) {
printf("In InetChecksum...\n");
printf("iplen: %d, tcplen: %d\n", ip_len, tcp_len);
}
sum = (sum & 0xffff) + (sum >> 16);
}
- if (session.debug == SESSION_DEBUG_HIGH) {
+ if (session.debug >= SESSION_DEBUG_HIGH) {
printf("Out InetChecksum...\n");
}
struct IpHeader *ip = p->ip;
struct TcpHeader *tcp = p->tcp;
- if (session.debug == SESSION_DEBUG_HIGH) {
+ if (session.debug >= SESSION_DEBUG_HIGH) {
printf("In WriteIPPacket...\n");
}
ip->ip_off = IP_DF;
ip->ip_len = (uint16)(sizeof(struct IpHeader) + ip_optlen + sizeof(struct TcpHeader) + optlen + datalen);
- if (session.debug == SESSION_DEBUG_HIGH) {
+ ip->ip_xsum = 0;
+ ip->ip_xsum = InetChecksum((uint16 *)ip, NULL,
+ (uint16)sizeof(struct IpHeader) + ip_optlen, /* IP Options should aren't included */
+ 0);
+
+ if (session.debug >= SESSION_DEBUG_HIGH) {
printf("Out WriteIPPacket...\n");
}
{
struct IPPacket *p;
- if (session.debug == SESSION_DEBUG_HIGH) {
+ if (session.debug >= SESSION_DEBUG_HIGH) {
printf("In AllocateIPPacket: %s...\n", str);
}
Quit(ERR_MEM_ALLOC);
}
- if (session.debug == SESSION_DEBUG_HIGH) {
+ if (session.debug >= SESSION_DEBUG_HIGH) {
printf("Out of AllocateIPPacket: %s...\n", str);
}
return(p);