# miniupnpd won't compile on FreeBSD 9



## megapearl (Apr 14, 2012)

Hello,

I upgraded FreeBSD 8.2 to FreeBSD 9.0 and now miniupnpd won't compile anymore.
I use ipf and ipnat as firewall.


```
[root@server /usr/ports/net/miniupnpd]# make install
===>  Building for miniupnpd-1.5,1
cc -O2 -pipe -fno-strict-aliasing  -c -o pf/obsdrdr.o pf/obsdrdr.c
pf/obsdrdr.c: In function 'add_redirect_rule2':
pf/obsdrdr.c:210: error: 'tag' undeclared (first use in this function)
pf/obsdrdr.c:210: error: (Each undeclared identifier is reported only once
pf/obsdrdr.c:210: error: for each function it appears in.)
*** Error code 1

Stop in /usr/ports/net/miniupnpd/work/miniupnpd-1.5.
*** Error code 1

Stop in /usr/ports/net/miniupnpd.
*** Error code 1

Stop in /usr/ports/net/miniupnpd.
[root@server /usr/ports/net/miniupnpd]#

[root@server /usr/ports/net/miniupnpd]# uname -a
FreeBSD server.mydomain.com 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:46:30 UTC 2012    
 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

[root@server /usr/ports/net/miniupnpd]# cat Makefile
# New ports collection makefile for:    miniupnpd
# Date created:         22 March 2007
# Whom:                 Daniel O'Connor <darius@dons.net.au>
#
# $FreeBSD: ports/net/miniupnpd/Makefile,v 1.17 2011/04/20 07:01:55 erwin Exp $
#

PORTNAME=       miniupnpd
PORTVERSION=    1.5
PORTEPOCH=      1
CATEGORIES=     net
MASTER_SITES=   http://miniupnp.tuxfamily.org/files/ \
                http://miniupnp.free.fr/files/

MAINTAINER=     squat@squat.no
COMMENT=        A UPnP IGD implementation which uses pf/ipf

SUB_FILES=      miniupnpd.conf.sample
SUB_LIST=       UUID=${UUID}

UUID!=          uuidgen
FWNAME?=        ipf
PLIST_FILES=    etc/miniupnpd.conf.sample sbin/miniupnpd

MAN8=           miniupnpd.8

USE_RC_SUBR=    miniupnpd.sh

OPTIONS=        PF_ENABLE_FILTER_RULES          "Enable pf generation of filter rules" off \

.include <bsd.port.options.mk>
.if defined(WITH_PF_ENABLE_FILTER_RULES)
EXTRA_PATCHES=  ${PATCHDIR}/pf_enable_filter_rules.patch
.endif

do-install:
        @${INSTALL_PROGRAM} ${WRKSRC}/miniupnpd ${PREFIX}/sbin/miniupnpd
        @${INSTALL_DATA} ${WRKDIR}/miniupnpd.conf.sample ${PREFIX}/etc/miniupnpd.conf.sample
        @${INSTALL_MAN} ${WRKSRC}/miniupnpd.1 ${PREFIX}/man/man8/miniupnpd.8
        @${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>
[root@server /usr/ports/net/miniupnpd]#
```

Why is it trying to compile pf? Anybody an idea to get it to compile?

Any help would be appreciated.
Regards,
Donald.


----------



## sk8harddiefast (Apr 15, 2012)

```
pkg_add -r miniupnpd
```
This will solve the problem


----------



## megapearl (Apr 15, 2012)

*Did install*

That indeed did the trick to install it, but how do *I* get it to work with ipf instead of pf?


```
[root@server /usr/local/etc/rc.d]# ./miniupnpd restart
miniupnpd not running? (check /var/run/miniupnpd.pid).
Starting miniupnpd.
[root@server /usr/local/etc/rc.d]# tail -f /var/log/syslog
Apr 15 15:39:22 server kernel: Apr 15 15:39:22 server miniupnpd[42162]: Failed to init redirection engine. EXITING
Apr 15 15:39:34 server miniupnpd: SNet version started
Apr 15 15:39:34 server kernel: Apr 15 15:39:34 server miniupnpd[42174]: open("/dev/pf"): No such file or directory
Apr 15 15:39:34 server kernel: Apr 15 15:39:34 server miniupnpd[42174]: Failed to init redirection engine. EXITING
Apr 15 15:40:51 server miniupnpd: SNet version started
Apr 15 15:40:51 server kernel: Apr 15 15:40:51 server miniupnpd[42201]: open("/dev/pf"): No such file or directory
Apr 15 15:40:51 server kernel: Apr 15 15:40:51 server miniupnpd[42201]: Failed to init redirection engine. EXITING
Apr 15 15:41:20 server miniupnpd: SNet version started
Apr 15 15:41:20 server kernel: Apr 15 15:41:20 server miniupnpd[42217]: open("/dev/pf"): No such file or directory
Apr 15 15:41:20 server kernel: Apr 15 15:41:20 server miniupnpd[42217]: Failed to init redirection engine. EXITING
```


----------



## SirDice (Apr 16, 2012)

If I'm not mistaken it only works with PF and IPFW, not IPF.

I would suggest using PF anyway. The syntax is mostly the same. IPF hasn't had a lot of development over the past few years.


----------

