summaryrefslogtreecommitdiffstats
path: root/gisi/pep.c
diff options
context:
space:
mode:
Diffstat (limited to 'gisi/pep.c')
-rw-r--r--gisi/pep.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gisi/pep.c b/gisi/pep.c
index 54954019..ba981732 100644
--- a/gisi/pep.c
+++ b/gisi/pep.c
@@ -85,8 +85,10 @@ GIsiPEP *g_isi_pep_create(GIsiModem *modem, GIsiPEPCallback cb, void *opaque)
fcntl(fd, F_SETFD, FD_CLOEXEC);
fcntl(fd, F_SETFL, O_NONBLOCK|fcntl(fd, F_GETFL));
- if (if_indextoname(ifi, buf) == NULL ||
- setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, buf, IF_NAMESIZE))
+ if (if_indextoname(ifi, buf) == NULL)
+ goto error;
+
+ if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, buf, IF_NAMESIZE) != 0)
goto error;
pep->ready = cb;