miniupnpd not inserting pf rules

krad kraduk at
Wed Dec 11 15:00:03 UTC 2013

I have being having some trouble/fun with miniupnpd, in that it didnt seem
to be inserting the rules into pf ( pfctl -sr -a miniupnpd
). The rdr rules are inserted fine just not the firewall rules at the rules
anchor. I think I have traced the problem down to the port build itself. I
have tested and reproduced it on a clean system on both 9.2 and 10 64bit
intel builds, but I would be good to have a sanity check make sure i have
not missed something before I raise a pr/bug report to the maintainer.

The problem lies with the extra_patch that isnt applied even if the
dialogue option is checked. Manually specifying it in the environment
doesn't work either

EXTRA_PATCHES=  ${PATCHDIR}/pf_enable_filter_rules.patch

the patch basically modifys the ports 'work/miniupnpd-1.8/'
script and uncomments the PF_ENABLE_FILTER_RULES option. However the port
doesnt do this no matter what I do. Manually applying the patch does
though, so I can only assume its a badly crafted Makefile (i have a clean
svnup'd ports tree). This seems to affect the binary package as well

[root at carrera /usr/ports/net/miniupnpd]# make clean ; rm -rf work ; make
>/dev/null ; echo $?
===>  Cleaning for miniupnpd-1.8,1
./ WARNING: $ipfilter_enable is not set properly - see
[root at carrera /usr/ports/net/miniupnpd]# grep PF_ENABLE_FILTER_RULES
[root at carrera /usr/ports/net/miniupnpd]# cd  work/miniupnpd-1.8/

[root at carrera /usr/ports/net/miniupnpd/work/miniupnpd-1.8]# patch <
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
|---  2012-06-18 18:14:32.899227837 +0200
|+++       2012-06-18 18:14:45.089227683 +0200
Patching file using Plan A...
Hunk #1 succeeded at 321 (offset 19 lines).
[root at carrera /usr/ports/net/miniupnpd/work/miniupnpd-1.8]# grep

running a debug on make I see no mention pf extra patch files being applied
as well

More information about the freebsd-ports mailing list