Project

General

Profile

Actions

Bug #1896

closed

ggsn unable to set tun interface on FreeBSD v11

Added by dev9null over 7 years ago. Updated over 4 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
12/23/2016
Due date:
% Done:

0%

Spec Reference:

Description

Trying to start-up ggsn on a FreeBSD v11 box with

listen: 1.1.1.1
net 192.168.1.0/24
dynip: 192.168.1.0/24

results in errno 22 from tun.c

root@soak01:~ # ggsn -c /usr/local/etc/ggsn.conf -f -d                                                                                         
listen: (null)
conf: /usr/local/etc/ggsn.conf
fg: 1
debug: 1
qos: 0x0b921f
apn: internet
net: 192.168.0.0/24
pidfile: /var/run/ggsn.pid
statedir: /var/lib/ggsn/
timelimit: 0
cmdline_parser_configfile
listen: 1.1.1.1
conf: /usr/local/etc/ggsn.conf
fg: 1
debug: 1
qos: 0x0b921f
apn: internet
net: 192.168.1.0/24
dynip: 192.168.1.0/24
pidfile: /var/run/ggsn.pid
statedir: /var/lib/ggsn/
timelimit: 0
<000c> gtp.c:700 GTP: gtp_newgsn() started
<0001> tun.c:443 errno=22/Invalid argument ioctl(SIOCSIFADDR) failed
<0002> ggsn.c:518 Failed to set tun IP address

ggsn is able to create the tun0 interface

root@soak01:/usr/local/etc # ifconfig
vmx0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=60039b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,TSO6,RXCSUM_IPV6,TXCSUM_IPV6>
        ether 00:50:56:b1:95:31
        inet 10.5.8.201 netmask 0xffffff00 broadcast 10.5.8.255 
        inet6 fe80::250:56ff:feb1:9531%vmx0 prefixlen 64 scopeid 0x1 
        inet6 2001:1890:12f2:20::a05:8c9 prefixlen 64 
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        media: Ethernet autoselect
        status: active
vmx1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=60039b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,TSO6,RXCSUM_IPV6,TXCSUM_IPV6>
        ether 00:50:56:b1:55:8c
        inet 1.1.1.1 netmask 0xffffff00 broadcast 1.1.1.255 
        inet6 fe80::250:56ff:feb1:558c%vmx1 prefixlen 64 scopeid 0x2 
        inet6 fdf6:4cfb:1::1 prefixlen 64 
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        media: Ethernet autoselect
        status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128 
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 
        inet 127.0.0.1 netmask 0xff000000 
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        groups: lo 
tun0: flags=8010<POINTOPOINT,MULTICAST> metric 0 mtu 1500
        options=80000<LINKSTATE>
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        groups: tun 

This looks to be the code section where it is failing:

 if (addr) { /* Set the interface address */
    this->addr.s_addr = addr->s_addr;
    memcpy(&((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr, addr,
      sizeof(*addr));
    if (ioctl(fd, SIOCSIFADDR, (void *) &ifr) < 0) {
      if (errno != EEXIST) {
    sys_err(LOG_ERR, __FILE__, __LINE__, errno,
        "ioctl(SIOCSIFADDR) failed");
      }
      else {
    sys_err(LOG_WARNING, __FILE__, __LINE__, errno,
        "ioctl(SIOCSIFADDR): Address already exists");
      }
      close(fd);
      return -1;
    }
  }

The server is running

FreeBSD soak01.eng.paloaltonetworks.local 11.0-RELEASE-p2 FreeBSD 11.0-RELEASE-p2 #0: Mon Oct 24 06:55:27 UTC 2016     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64

and

openggsn-0.92

was install using the pkg command

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)