aports/main/cutter/musl-fix.patch
2022-10-25 18:04:39 +02:00

40 lines
1.1 KiB
Diff

diff --git a/Makefile b/Makefile
index 1f11226..d347768 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
cutter: cutter.c
- cc cutter.c -o cutter
+ cc $(CFLAGS) cutter.c -o cutter $(LDFLAGS)
clean:
rm -f cutter.o cutter
diff --git a/cutter.c b/cutter.c
index 1c639c9..0d0466b 100644
--- a/cutter.c
+++ b/cutter.c
@@ -44,7 +44,6 @@
#include <linux/socket.h>
#include <linux/ip.h>
#include <linux/tcp.h>
-#include <linux/if_ether.h>
#include <fcntl.h>
#include <netpacket/packet.h>
#include <net/ethernet.h> /* the L2 protocols */
@@ -54,6 +53,7 @@
#include <arpa/inet.h>
#include <net/if.h>
#include <errno.h>
+#include <time.h>
#define ETHHDR sizeof(struct ethhdr)
#define TCPHDR sizeof(struct tcphdr)
@@ -129,7 +129,7 @@ int getnexthop(in_addr_t ip, char *intf, in_addr_t *gateway)
dest_ip = gateway_ip = flags = refcnt = use
= metric = mask = mtu = window = irtt = -1;
- if (sscanf(buff, "%s %8lx %8lx %4x %d %d %d %8lx %d %d %d",
+ if (sscanf(buff, "%s %8x %8x %4x %d %d %d %8x %d %d %d",
iface, &dest_ip, &gateway_ip, &flags, &refcnt,
&use, &metric, &mask, &mtu, &window, &irtt
) == 11) {