summaryrefslogtreecommitdiffstats
path: root/gatchat
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2011-05-25 05:30:38 -0500
committerDenis Kenzior <denkenz@gmail.com>2011-05-25 05:30:38 -0500
commit92e0657eed0b0777e5a7e3502b450aa42921fc8c (patch)
tree3e9bc6733900d04e9aa42297c63a078254543bb9 /gatchat
parentafce58224616c57f8878680e8c9114226b93bdc8 (diff)
downloadofono-92e0657eed0b0777e5a7e3502b450aa42921fc8c.tar.bz2
ppp_net: Keep valgrind happy
Diffstat (limited to 'gatchat')
-rw-r--r--gatchat/ppp_net.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gatchat/ppp_net.c b/gatchat/ppp_net.c
index 1c81de07..6facc6d7 100644
--- a/gatchat/ppp_net.c
+++ b/gatchat/ppp_net.c
@@ -142,13 +142,14 @@ struct ppp_net *ppp_net_new(GAtPPP *ppp, int fd)
* If the fd value is still the default one,
* open the tun interface and configure it.
*/
+ memset(&ifr, 0, sizeof(ifr));
+
if (fd < 0) {
/* open a tun interface */
fd = open("/dev/net/tun", O_RDWR);
if (fd < 0)
goto error;
- memset(&ifr, 0, sizeof(ifr));
ifr.ifr_flags = IFF_TUN | IFF_NO_PI;
strcpy(ifr.ifr_name, "ppp%d");