main/cutter: use source from archive, fix warnings

This commit is contained in:
Natanael Copa 2022-10-25 18:01:27 +02:00
parent 56fda6d078
commit 6cc87c40d6
2 changed files with 39 additions and 7 deletions

View file

@ -2,14 +2,14 @@
# Maintainer: Michael Mason <ms13sp@gmail.com>
pkgname=cutter
pkgver=1.04
pkgrel=2
pkgrel=3
pkgdesc="A program that allows firewall administrators to abort TCP/IP connections"
url="http://www.digitage.co.uk/digitage/software/linux-security/cutter"
arch="all"
license="GPL-2.0"
makedepends="linux-headers"
options="!check"
source="http://www.digitage.co.uk/digitage/files/cutter/$pkgname-$pkgver.tgz
source="http://dev.alpinelinux.org/archive/cutter/cutter-$pkgver.tgz
musl-fix.patch"
build() {
@ -20,5 +20,7 @@ package() {
install -m755 -D $pkgname "$pkgdir"/usr/sbin/$pkgname
}
sha512sums="79c17ec8c17e696a79aa8b11fda347f2e6929eb35f9a37da450acf6aff7ab9471e13eaef24708f90f3f0c2791fade2eb944443b98df3d3ae4eef0c408abc7b3a cutter-1.04.tgz
815ffcfbae6865443b49390f1c5dc583243009150271804468aad00102b136ac2e6abe565efa18d15f4411690444ca6fdd1184a8b31e61f5a62115f87f6d53dc musl-fix.patch"
sha512sums="
79c17ec8c17e696a79aa8b11fda347f2e6929eb35f9a37da450acf6aff7ab9471e13eaef24708f90f3f0c2791fade2eb944443b98df3d3ae4eef0c408abc7b3a cutter-1.04.tgz
fca7cabce0b142c31bcbbede138f20c7389e58d8ad9d82480526b5ab90165ce6493d54c3a3e9270f02bccc08ae248a7b4d62b34bb26c117e6f4b18106c37106d musl-fix.patch
"

View file

@ -1,6 +1,19 @@
--- ./cutter.c.orig
+++ ./cutter.c
@@ -47,7 +47,6 @@
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>
@ -8,3 +21,20 @@
#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) {