1
0

patch-cutter_c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 2013-12-24 12:14:44.000000000 +0100
  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. @@ -50,7 +54,9 @@
  15. #include <linux/if_ether.h>
  16. #include <fcntl.h>
  17. #include <netpacket/packet.h>
  18. +#if defined(__GLIBC__)
  19. #include <net/ethernet.h> /* the L2 protocols */
  20. +#endif
  21. #include <linux/sockios.h>
  22. #include <sys/ioctl.h>
  23. #include <netinet/in.h>
  24. @@ -297,7 +303,7 @@ int send_rst(
  25. pheader.placeholder=0;
  26. pheader.protocol=IPPROTO_TCP;
  27. pheader.tcp_length=htons(TCPHDR);
  28. - bcopy((char *)&tpack.tcp,(char *)&pheader.tcp,TCPHDR);
  29. + memcpy((char *)&pheader.tcp,(char *)&tpack.tcp,TCPHDR);
  30. tpack.tcp.check=in_cksum((unsigned short *)&pheader,TCPHDR+12);
  31. /*
  32. @@ -419,7 +425,7 @@ int send_rst(
  33. pheader.placeholder=0;
  34. pheader.protocol=IPPROTO_TCP;
  35. pheader.tcp_length=htons(TCPHDR);
  36. - bcopy((char *)&tpack.tcp,(char *)&pheader.tcp,TCPHDR);
  37. + memcpy((char *)&pheader.tcp,(char *)&tpack.tcp,TCPHDR);
  38. tpack.tcp.check=in_cksum((unsigned short *)&pheader,TCPHDR+12);
  39. i_result = sendto(raw_sock,&tpack,PACKETSIZE,0,(void*)&hisaddr,sizeof(hisaddr));