diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-08-12 15:07:02 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-09-06 09:17:11 +0200 |
commit | dda21ed7d4a897c9284c69175d0da598598eae40 (patch) | |
tree | 1b9947a6affc8811c5b6a9153cbde18900c99457 /lib/tun.c | |
parent | 2778ae2b8f7780fd0bebb520aa0900b5418aad93 (diff) |
Introduce a VTY, factually turning OpenGGSN into an Osmocom program
Change-Id: I9613ca3436e77ea132c47f0096df7c5050d7e826
Diffstat (limited to 'lib/tun.c')
-rw-r--r-- | lib/tun.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -583,7 +583,7 @@ int tun_delroute(struct tun_t *this, return tun_route(this, dst, gateway, mask, 1); } -int tun_new(struct tun_t **tun) +int tun_new(struct tun_t **tun, const char *dev_name) { #if defined(__linux__) @@ -615,6 +615,8 @@ int tun_new(struct tun_t **tun) /* Set device flags. For some weird reason this is also the method used to obtain the network interface name */ memset(&ifr, 0, sizeof(ifr)); + if (dev_name) + strcpy(ifr.ifr_name, dev_name); ifr.ifr_flags = IFF_TUN | IFF_NO_PI; /* Tun device, no packet info */ if (ioctl((*tun)->fd, TUNSETIFF, (void *)&ifr) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "ioctl() failed"); |