summaryrefslogtreecommitdiff
path: root/package/cutter/patches/patch-cutter_c
blob: 0842a6dd90b3757a88816f9dfd5cce9a2b1a166b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
--- cutter-1.03.orig/cutter.c	2005-04-30 09:01:03.000000000 +0200
+++ cutter-1.03/cutter.c	2013-12-24 12:14:44.000000000 +0100
@@ -35,6 +35,10 @@
  * 		improvment.
  */
 
+#ifndef __packed
+#define __packed __attribute__((packed))
+#endif
+
 #include <string.h>
 #include <stdio.h>
 #include <unistd.h>
@@ -50,7 +54,9 @@
 #include <linux/if_ether.h>
 #include <fcntl.h>
 #include <netpacket/packet.h>
+#if defined(__GLIBC__)
 #include <net/ethernet.h>     /* the L2 protocols */
+#endif
 #include <linux/sockios.h>
 #include <sys/ioctl.h>
 #include <netinet/in.h>
@@ -297,7 +303,7 @@ int send_rst(
 	pheader.placeholder=0;
 	pheader.protocol=IPPROTO_TCP;
 	pheader.tcp_length=htons(TCPHDR);
-	bcopy((char *)&tpack.tcp,(char *)&pheader.tcp,TCPHDR);
+	memcpy((char *)&pheader.tcp,(char *)&tpack.tcp,TCPHDR);
 	tpack.tcp.check=in_cksum((unsigned short *)&pheader,TCPHDR+12);
 
 	/*
@@ -419,7 +425,7 @@ int send_rst(
 			pheader.placeholder=0;
 			pheader.protocol=IPPROTO_TCP;
 			pheader.tcp_length=htons(TCPHDR);
-			bcopy((char *)&tpack.tcp,(char *)&pheader.tcp,TCPHDR);
+			memcpy((char *)&pheader.tcp,(char *)&tpack.tcp,TCPHDR);
 			tpack.tcp.check=in_cksum((unsigned short *)&pheader,TCPHDR+12);
 
 			i_result = sendto(raw_sock,&tpack,PACKETSIZE,0,(void*)&hisaddr,sizeof(hisaddr));