patch-cutter_c 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
  2. --- cutter-1.03.orig/cutter.c 2005-04-30 09:01:03.000000000 +0200
  3. +++ cutter-1.03/cutter.c 2011-08-24 18:49:58.830478484 +0200
  4. @@ -35,6 +35,10 @@
  5. * improvment.
  6. */
  7. +#ifndef __packed
  8. +#define __packed __attribute__((packed))
  9. +#endif
  10. +
  11. #include <string.h>
  12. #include <stdio.h>
  13. #include <unistd.h>
  14. @@ -297,7 +301,7 @@ int send_rst(
  15. pheader.placeholder=0;
  16. pheader.protocol=IPPROTO_TCP;
  17. pheader.tcp_length=htons(TCPHDR);
  18. - bcopy((char *)&tpack.tcp,(char *)&pheader.tcp,TCPHDR);
  19. + memcpy((char *)&pheader.tcp,(char *)&tpack.tcp,TCPHDR);
  20. tpack.tcp.check=in_cksum((unsigned short *)&pheader,TCPHDR+12);
  21. /*
  22. @@ -419,7 +423,7 @@ int send_rst(
  23. pheader.placeholder=0;
  24. pheader.protocol=IPPROTO_TCP;
  25. pheader.tcp_length=htons(TCPHDR);
  26. - bcopy((char *)&tpack.tcp,(char *)&pheader.tcp,TCPHDR);
  27. + memcpy((char *)&pheader.tcp,(char *)&tpack.tcp,TCPHDR);
  28. tpack.tcp.check=in_cksum((unsigned short *)&pheader,TCPHDR+12);
  29. i_result = sendto(raw_sock,&tpack,PACKETSIZE,0,(void*)&hisaddr,sizeof(hisaddr));