summaryrefslogtreecommitdiff
path: root/src/dumm/iface.c
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2010-02-23 10:34:14 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2010-02-23 10:34:14 +0000
commited7d79f96177044949744da10f4431c1d6242241 (patch)
tree3aabaa55ed3b5291daef891cfee9befb5235e2b8 /src/dumm/iface.c
parent7410d3c6d6a9a1cd7aa55083c938946af6ff9498 (diff)
downloadvyos-strongswan-ed7d79f96177044949744da10f4431c1d6242241.tar.gz
vyos-strongswan-ed7d79f96177044949744da10f4431c1d6242241.zip
[svn-upgrade] Integrating new upstream version, strongswan (4.3.6)
Diffstat (limited to 'src/dumm/iface.c')
-rw-r--r--src/dumm/iface.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/dumm/iface.c b/src/dumm/iface.c
index bf73c82a5..9910c392e 100644
--- a/src/dumm/iface.c
+++ b/src/dumm/iface.c
@@ -55,10 +55,10 @@ bool iface_control(char *name, bool up)
int s;
bool good = FALSE;
struct ifreq ifr;
-
+
memset(&ifr, 0, sizeof(struct ifreq));
strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
-
+
s = socket(AF_INET, SOCK_DGRAM, 0);
if (!s)
{
@@ -104,7 +104,7 @@ static char* get_hostif(private_iface_t *this)
*/
static bool add_address(private_iface_t *this, host_t *addr)
{
- return (this->guest->exec(this->guest, NULL, NULL,
+ return (this->guest->exec(this->guest, NULL, NULL,
"exec ip addr add %H dev %s", addr, this->guestif) == 0);
}
@@ -185,7 +185,7 @@ static guest_t* get_guest(private_iface_t *this)
{
return this->guest;
}
-
+
/**
* destroy the tap device
*/
@@ -193,7 +193,7 @@ static bool destroy_tap(private_iface_t *this)
{
struct ifreq ifr;
int tap;
-
+
if (!iface_control(this->hostif, FALSE))
{
DBG1("bringing iface down failed: %m");
@@ -201,7 +201,7 @@ static bool destroy_tap(private_iface_t *this)
memset(&ifr, 0, sizeof(ifr));
ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
strncpy(ifr.ifr_name, this->hostif, sizeof(ifr.ifr_name) - 1);
-
+
tap = open(TAP_DEVICE, O_RDWR);
if (tap < 0)
{
@@ -241,11 +241,11 @@ static char* create_tap(private_iface_t *this)
if (ioctl(tap, TUNSETIFF, &ifr) < 0 ||
ioctl(tap, TUNSETPERSIST, 1) < 0 ||
ioctl(tap, TUNSETOWNER, 0))
- {
+ {
DBG1("creating new tap device failed: %m");
close(tap);
return NULL;
- }
+ }
close(tap);
return strdup(ifr.ifr_name);
}
@@ -274,7 +274,7 @@ static void destroy(private_iface_t *this)
iface_t *iface_create(char *name, guest_t *guest, mconsole_t *mconsole)
{
private_iface_t *this = malloc_thing(private_iface_t);
-
+
this->public.get_hostif = (char*(*)(iface_t*))get_hostif;
this->public.get_guestif = (char*(*)(iface_t*))get_guestif;
this->public.add_address = (bool(*)(iface_t*, host_t *addr))add_address;