miniupnp.tuxfamily.org Forum Index miniupnp.tuxfamily.org
The forum about miniupnp and libnatpmp
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compilation error on Ubuntu 13.10

 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Compilation/Installation
View previous topic :: View next topic  
Author Message
offbynull



Joined: 27 Jan 2014
Posts: 11

PostPosted: Mon Jan 27, 2014 1:26 am    Post subject: Compilation error on Ubuntu 13.10 Reply with quote

I'm trying to build and set up a test miniupnpd server in a Ubuntu 13.10 VM. After enabling PCP and IPv6 in config.h, I get a couple of issues in pcpserver.c. The first is:

pcpserver.c: In function ‘parsePCPPEER_version1’:
pcpserver.c:308:33: error: cannot convert to a pointer type
pcp_msg_info->ext_ip = (struct in6_addr*)peer_buf->ext_ip;
^
pcpserver.c:309:34: error: cannot convert to a pointer type
pcp_msg_info->peer_ip = (struct in6_addr*)peer_buf->peer_ip;
^
pcpserver.c: In function ‘parsePCPPEER_version2’:
pcpserver.c:332:33: error: cannot convert to a pointer type
pcp_msg_info->ext_ip = (struct in6_addr*)peer_buf->ext_ip;
^
pcpserver.c:333:34: error: cannot convert to a pointer type
pcp_msg_info->peer_ip = (struct in6_addr*)peer_buf->peer_ip;
^
pcpserver.c: In function ‘createPCPResponse’:
pcpserver.c:1261:4: warning: implicit declaration of function ‘IPV6_ADDR_COPY’ [-Wimplicit-function-declaration]
IPV6_ADDR_COPY((uint32_t*)peer_resp->ext_ip,
^
pcpserver.c:1261:4: error: cannot convert to a pointer type
pcpserver.c:1269:4: error: cannot convert to a pointer type
IPV6_ADDR_COPY((uint32_t*)peer_resp->ext_ip,
^
make: *** [pcpserver.o] Error 1


I removed the casts and referenced address of the struct to get these compilation errors to go away. The next issue that came up is:

pcpserver.o: In function `ProcessIncomingPCPPacket':
pcpserver.cSad.text+0x6c7): undefined reference to `IPV6_ADDR_COPY'
collect2: error: ld returned 1 exit status
make: *** [miniupnpd] Error 1

IPV6_ADDR_COPY isn't defined anywhere. I'm not sure what to do about this.


Can anyone provide some guidance on getting the PCP server to compile properly?
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Mon Jan 27, 2014 9:57 am    Post subject: Reply with quote

Indeed there is a problem when enabling PCP_PEER.
I'm going to fix this.
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Mon Jan 27, 2014 11:28 am    Post subject: Reply with quote

https://github.com/miniupnp/miniupnp/commit/064fcd27396d100d648d57383d42d978dd17aed4

and miniupnpd-1.8.20140127.tar.gz
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
offbynull



Joined: 27 Jan 2014
Posts: 11

PostPosted: Mon Jan 27, 2014 9:16 pm    Post subject: Reply with quote

Thanks. I'll give it another try tonight.

I'm trying to use miniupnpd to test my open source java portmapping client. Is there a setup guide anywhere once I get the compilation to successfully finish?
Back to top
View user's profile Send private message
offbynull



Joined: 27 Jan 2014
Posts: 11

PostPosted: Tue Jan 28, 2014 3:22 am    Post subject: Reply with quote

It looks like the compilation problems have gone away with the latest code. I was able to compile and install.

So far everything looks good. The only issue I've encountered thus far is when I uncomment the friendly name param in the conf file:

invalid option in file /etc/miniupnpd/miniupnpd.conf line 51 : friendly_name=MiniUPnPd router

I've set my conf file to use eth1 for WAN and eth0 for LAN, and the slightly revised the default permission rules to make it easier to test. If you have a moment to spare, please take a look and let me know if anything seems incorrect. Thanks again for taking time to patch up the PCP issues.


user@ubuntu:~/miniupnp/miniupnpd$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:0c:29:90:9d:e9
inet addr:192.168.25.129 Bcast:192.168.25.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe90:9de9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8627 errors:0 dropped:0 overruns:0 frame:0
TX packets:1550 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:11203214 (11.2 MB) TX bytes:149149 (149.1 KB)

eth1 Link encap:Ethernet HWaddr 00:0c:29:90:9d:f3
inet addr:192.168.25.130 Bcast:192.168.25.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe90:9df3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:22 errors:0 dropped:0 overruns:0 frame:0
TX packets:53 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2741 (2.7 KB) TX bytes:9526 (9.5 KB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:436 errors:0 dropped:0 overruns:0 frame:0
TX packets:436 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:47651 (47.6 KB) TX bytes:47651 (47.6 KB)




# WAN network interface
ext_ifname=eth1
#ext_ifname=xl1
# if the WAN interface has several IP addresses, you
# can specify the one to use below
#ext_ip=

# LAN network interfaces IPs / networks
# there can be multiple listening ips for SSDP traffic.
# should be under the form nnn.nnn.nnn.nnn/nn
# It can also be the network interface name (ie "eth0")
# It if mandatory to use the network interface name to enable IPv6
# HTTP is available on all interfaces.
# When MULTIPLE_EXTERNAL_IP is enabled, the external ip
# address associated with the subnet follows. for example :
# listening_ip=192.168.0.1/24 88.22.44.13
#listening_ip=192.168.0.1/24
#listening_ip=192.168.25.129/24
listening_ip=eth0
# port for HTTP (descriptions and SOAP) traffic. set 0 for autoselect.
port=0

# path to the unix socket used to communicate with MiniSSDPd
# If running, MiniSSDPd will manage M-SEARCH answering.
# default is /var/run/minissdpd.sock
#minissdpdsocket=/var/run/minissdpd.sock

# enable NAT-PMP support (default is no)
enable_natpmp=yes

# enable UPNP support (default is yes)
enable_upnp=yes

# configure minimal and maximal lifetime of the port mapping in seconds
# 120s and 86400s (24h) are suggested values from PCP-base
min_lifetime=120
max_lifetime=86400

# chain names for netfilter (not used for pf or ipf).
# default is MINIUPNPD for both
#upnp_forward_chain=forwardUPnP
#upnp_nat_chain=UPnP

# lease file location
#lease_file=/var/log/upnp.leases

# to enable the next few runtime options, see compile time
# ENABLE_MANUFACTURER_INFO_CONFIGURATION (config.h)

# name of this service, default is "`uname -s` router"
#friendly_name=MiniUPnPd router

# manufacturer name, default is "`uname -s`"
#manufacturer_name=Manufacturer corp

# manufacturer url, default is URL of OS verndor
#manufacturer_url=http://miniupnp.free.fr/

# model name, default is "`uname -s` router"
#model_name=Router Model

# model description, default is "`uname -s` router"
#model_description=Very Secure Router - Model

# model url, default is URL of OS vendor
#model_url=http://miniupnp.free.fr/

# bitrates reported by daemon in bits per second
bitrate_up=1000000
bitrate_down=10000000

# "secure" mode : when enabled, UPnP client are allowed to add mappings only
# to their IP.
#secure_mode=yes
secure_mode=no

# default presentation url is http address on port 80
# If set to an empty string, no presentationURL element will appear
# in the XML description of the device, which prevents MS Windows
# from displaying an icon in the "Network Connections" panel.
#presentation_url=http://www.mylan/index.php

# report system uptime instead of daemon uptime
system_uptime=yes

# notify interval in seconds. default is 30 seconds.
#notify_interval=240
notify_interval=60

# unused rules cleaning.
# never remove any rule before this threshold for the number
# of redirections is exceeded. default to 20
#clean_ruleset_threshold=10
# clean process work interval in seconds. default to 0 (disabled).
# a 600 seconds (10 minutes) interval makes sense
clean_ruleset_interval=600

# log packets in pf (default is no)
#packet_log=no

# anchor name in pf (default is miniupnpd)
#anchor=miniupnpd

# ALTQ queue in pf
# filter rules must be used for this to be used.
# compile with PF_ENABLE_FILTER_RULES (see config.h file)
#queue=queue_name1

# tag name in pf
#tag=tag_name1

# make filter rules in pf quick or not. default is yes
# active when compiled with PF_ENABLE_FILTER_RULES (see config.h file)
#quickrules=no

# uuid : generate your own with "make genuuid"
uuid=bd8b5216-449b-43fe-a842-03a064b8636e

# serial and model number the daemon will report to clients
# in its XML description
serial=12345678
model_number=1

# UPnP permission rules
# (allow|deny) (external port range) ip/mask (internal port range)
# A port range is <min port>-<max port> or <port> if there is only
# one port in the range.
# ip/mask format must be nn.nn.nn.nn/nn
# it is advised to only allow redirection of port above 1024
# and to finish the rule set with "deny 0-65535 0.0.0.0/0 0-65535"
allow 1024-65535 192.168.25.0/24 1024-65535
deny 0-65535 0.0.0.0/0 0-65535
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Tue Jan 28, 2014 9:25 am    Post subject: Reply with quote

your setup is a bit strange as eth0 and eth1 are on the same subnet...
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
offbynull



Joined: 27 Jan 2014
Posts: 11

PostPosted: Thu Jan 30, 2014 4:42 am    Post subject: Reply with quote

Corrected. I did a quick test with NAT-PMP and it looks it's working.

Thank again for your help!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Compilation/Installation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP
© 2007 Thomas Bernard, author of MiniUPNP.