move net-misc/pmtud here

This commit is contained in:
Andrey Abramov 2019-06-06 21:01:57 +03:00
parent f1964a2880
commit 48eaa11961
5 changed files with 105 additions and 0 deletions

1
net-misc/pmtud/Manifest Normal file
View File

@ -0,0 +1 @@
DIST v0.6.tar.gz 15970 SHA256 71df33f614e5dc1bd7d9789a73393cf259728ed0b87bcb8f6126eaf33afacad9 SHA512 cab49fbb8b04bfe563da74b1e7f8b14e171070addbe06ebbfb9ddf483eb229f25d34e33b912f192e2b6dccbfbcbee85ce66d57be898b80484f489a3c1b5129fe WHIRLPOOL 4abebe4209ae734fd949813732bf43a1c972226d19a032ab3b77bf679be667b75d7df4bea57f91241a205d72d316eaf956a0ad80578c6e495f102c637d28e3ff

View File

@ -0,0 +1,42 @@
CC ?= gcc
BUILD ?= release
LDOPTS += -Wl,-z,now -Wl,-z,relro -pie
COPTSWARN = -Wall -Wextra -Wno-unused-parameter -Wpointer-arith
COPTSSEC = -D_FORTIFY_SOURCE=2
ifeq ($(CC), clang)
COPTSSEC+=-fstack-protector-strong
else
COPTSSEC+=-fstack-protector
endif
COPTSDEBUG=-g -ggdb -O0
ifeq ($(BUILD), debugaddress)
COPTSDEBUG=-g -ggdb -O0 -fsanitize=address -fsanitize=undefined
endif
ifeq ($(BUILD), release)
MARCH=-march=corei7
COPTSDEBUG=-g -ggdb -O3 $(MARCH)
endif
COPTS+=$(CFLAGS) $(COPTSDEBUG) $(COPTSWARN) $(COPTSSEC) -fPIE \
-Ideps/libpcap -I deps/libnfnetlink/include -Ideps/libnetfilter_log/include
all: pmtud
pmtud: src/*.c src/*.h Makefile
$(CC) $(COPTS) \
src/main.c src/utils.c src/net.c src/uevent.c \
src/hashlimit.c src/csiphash.c src/sched.c \
src/bitmap.c src/nflog.c \
-lnetfilter_log -lpcap \
$(LDOPTS) \
-o pmtud
clean:
rm -rf pmtud pmtud_*.deb
distclean: clean
rm -f lib*.a
-(cd deps/libpcap && make clean && make distclean)
-(cd deps/libnfnetlink && make clean && make distclean)
-(cd deps/libnetfilter_log && make clean && make distclean)

View File

@ -0,0 +1,4 @@
# Example config file for /etc/init.d/pmtud
# Run `pmtud --help` for valid cmdline options
#PMTUD_OPTS=""

View File

@ -0,0 +1,24 @@
#!/sbin/openrc-run
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
INSTANCE="${SVCNAME#*.}"
if [ -n ${INSTANCE} ]; then
name="pmtud.${INSTANCE}"
pidfile=/run/pmtud/pmtud.${INSTANCE}.pid
else
name="pmtud"
pidfile=/run/pmtud/pmtud.pid
fi
command=/usr/sbin/pmtud
retry="TERM/10/KILL/5"
command_args="${PMTUD_OPTS}"
start_stop_daemon_args="--background --make-pidfile"
depend() {
use net
}
start_pre() {
checkpath --directory /run/pmtud -o pmtud -m 0700
}

View File

@ -0,0 +1,34 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit eutils user
DESCRIPTION="Broadcast lost ICMP packets on ECMP networks"
HOMEPAGE="https://github.com/cloudflare/pmtud"
SRC_URI="https://github.com/cloudflare/pmtud/archive/v${PV}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
RESTRICT="mirror"
RDEPEND="net-libs/libnetfilter_log
net-libs/libnfnetlink
net-libs/libpcap"
DEPEND="${RDEPEND}"
src_prepare() {
cp "${FILESDIR}/Makefile-v${PV}" Makefile
eapply_user
}
src_install() {
newinitd "${FILESDIR}/${PN}.initd" "${PN}"
newconfd "${FILESDIR}/${PN}.confd" "${PN}"
dosbin pmtud
dodoc README.md
}
pkg_setup() {
enewuser ${PN}
}