NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/53199: stateful npf
The following reply was made to PR kern/53199; it has been noted by GNATS.
From: Patrick Welche <prlw1%cam.ac.uk@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: kern/53199: stateful npf
Date: Fri, 4 May 2018 15:13:39 +0100
On Fri, May 04, 2018 at 02:10:01PM +0000, Patrick Welche wrote:
> The attached rump based script works. Trying the same on a NetBSD-8.99.15/amd64
> webserver with two wm(4), and morden.no as the client, doesn't.
surprised that pkgsrc mutt munged the attachement like that... Here using :r
#
# webserver 192.168.0.1 ----- client 192.168.0.2
#
sock_webserver=unix:///tmp/sockwebserver
sock_client=unix:///tmp/sockclient
wire1=/tmp/netbus1
#inetserver="rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_shmif"
inetserver=rump_allserver
${inetserver} ${sock_webserver}
export RUMP_SERVER=${sock_webserver}
rump.ifconfig shmif0 create
rump.ifconfig shmif0 linkstr $wire1
rump.ifconfig shmif0 inet 192.168.0.1 netmask 0xffffff00
cat > /tmp/npf.conf << EOF
set bpf.jit off
group "ext" on shmif0 {
block in all
pass stateful in proto tcp flags S/SA from any to 192.168.0.1 port 80
}
group default {
pass all
}
EOF
export 'RUMPHIJACK=path=/rump,blanket=/dev/npf,socket=all:nolocal,sysctl=yes'
env LD_PRELOAD=/usr/lib/librumphijack.so \
/sbin/npfctl validate /tmp/npf.conf
env LD_PRELOAD=/usr/lib/librumphijack.so \
/sbin/npfctl reload /tmp/npf.conf
env LD_PRELOAD=/usr/lib/librumphijack.so \
/sbin/npfctl start
cat > /tmp/webserver.html << EOF
<html>
<head>
<title>webserver</title>
</head>
<body>
Hello from webserver!
</body>
</html>
EOF
env LD_PRELOAD=/usr/lib/librumphijack.so \
/usr/libexec/httpd -d -P httpd.pid -i 192.168.0.1 -f -b -s /tmp &
${inetserver} ${sock_client}
export RUMP_SERVER=$sock_client
rump.ifconfig shmif0 create
rump.ifconfig shmif0 linkstr $wire1
rump.ifconfig shmif0 inet 192.168.0.2 netmask 0xffffff00
env LD_PRELOAD=/usr/lib/librumphijack.so \
/usr/bin/ftp -4 -n -d -o out 'http://192.168.0.1/webserver.html'
kill `cat httpd.pid`
for box in ${sock_webserver} ${sock_client}; do
export RUMP_SERVER=${box}
rump.halt
done
Home |
Main Index |
Thread Index |
Old Index