chiark / gitweb /
server: Introduce privilege separation.
[tripe] / server / peer.c
index 3cb12ea2b1f48fcdafc93679fa118cc14dd6cf93..4bb2c82c6b0f80b07da5f42ab928d7d61532270d 100644 (file)
@@ -742,9 +742,9 @@ peer *p_create(peerspec *spec)
   p->ifname = 0;
   memset(&p->st, 0, sizeof(stats));
   p->st.t_start = time(0);
-  if (!tops->open)
+  if (!(tops->flags & TUNF_PRIVOPEN))
     fd = -1;
-  else if ((fd = tops->open(&p->ifname)) < 0)
+  else if ((fd = ps_tunfd(tops, &p->ifname)) < 0)
     goto tidy_2;
   if ((p->t = tops->create(p, fd, &p->ifname)) == 0)
     goto tidy_3;