--- nmap.c~ Sun Sep 19 18:47:56 1999 +++ nmap.c Wed Sep 22 12:18:06 1999 @@ -1503,6 +1503,7 @@ too much to compute the TCP checksum.*/ char packet[sizeof(struct ip) + sizeof(struct tcphdr) + 100]; +char savepack[sizeof(struct ip) + 16]; struct ip *ip = (struct ip *) packet; struct tcphdr *tcp = (struct tcphdr *) (packet + sizeof(struct ip)); struct pseudo_header *pseudo = (struct pseudo_header *) (packet + sizeof(struct ip) - sizeof(struct pseudo_header)); @@ -1575,13 +1576,16 @@ /* Lets save this and send it AFTER we send the second one, just to be cute ;) */ -if ((res = sendto(sd, packet,sizeof(struct ip) + 16 , 0, +bcopy(packet, savepack, sizeof(struct ip) + 16); + +/* if ((res = sendto(sd, packet,sizeof(struct ip) + 16 , 0, (struct sockaddr *)&sock, sizeof(struct sockaddr_in))) == -1) { perror("sendto in send_syn_fragz"); return -1; - } + } if (o.debugging > 1) fprintf(o.nmap_stdout, "successfully sent %d bytes of raw_tcp!\n", res); +*/ /* Create the second fragment */ @@ -1613,6 +1617,16 @@ perror("sendto in send_tcp_raw frag #2"); return -1; } + + + if ((res = sendto(sd, savepack,sizeof(struct ip) + 16 , 0, + (struct sockaddr *)&sock, sizeof(struct sockaddr_in))) == -1) + { + perror("sendto in send_syn_fragz"); + return -1; + } +if (o.debugging > 1) fprintf(o.nmap_stdout, "successfully sent %d bytes of raw_tcp!\n", res); + return 1; }