Has anyone gotten l2tpd to work. I am not talking about ipsec with l2tp but plain l2tp. I am using Windows xp as a client and it just waits on verifying user name & password and then times out. After using the following patch I am able to make occasional connections, but most of the time I get 737: loop back error. Any help would be appriciated.
...you have to use Unix 98 ptys :
* recompile your kernel adding support for Unix 98 ptys
(make menuconfig => character devices)
* modify l2tpd code like this (changes based on l2tpd-0.63) :
* Add this include in pty.c :
#include <sys/types.h>
* Replace the function pty.c:getPtyMaster() by this one
int getPtyMaster(int *pl_slaveFd)
{
int vl_masterFd, vl_slaveFd;
char *pl_masterName;
long vl_arg;
/* Get a pty */
vl_masterFd = getpt();
if(vl_masterFd >= 0)
{
/* Set permissions on the pty */
grantpt(vl_masterFd);
unlockpt(vl_masterFd);
/* Extract the name of the device file associated */
pl_masterName = (char *)ptsname(vl_masterFd);
if (pl_masterName == NULL)
{
close(vl_masterFd);
log(LOG_CRIT,"%s: Unable to get the name of the master
pseudo-tty"s\n",__FUNCTION__);
return -1;
}
/* Open the slave part (the tty part) */
vl_slaveFd = open(pl_masterName, O_RDWR);
if (vl_slaveFd < 0)
{
close(vl_slaveFd);
log(LOG_CRIT,"%s: Unable to open slave pseudo-tty"s\n",__FUNCTION__);
return -1;
}
}
else
{
log(LOG_CRIT,"%s: Unable to allocate master pseudo-tty"s\n",__FUNCTION__);
return -1;
}
/* Put the master pty in non blocking mode */
vl_arg = fcntl(vl_masterFd, F_GETFL);
vl_arg |= O_NONBLOCK;
fcntl(vl_masterFd, F_SETFL, vl_arg);
/* Here everything is allright, return the fds */
*pl_slaveFd = vl_slaveFd;
return(vl_masterFd);
}
* Modify the prototype declaration of getPtyMaster in misc.h
* Replace this code in l2tpd.c:start_pppd()
if ((c->fd = getPtyMaster(&a, &b))<0)
{
log(LOG_WARN, "%s: unable to allocate pty, abandoning!\n",__FUNCTION__);
return -EINVAL;
}
snprintf(tty,sizeof(tty),"/dev/tty%c%c",a,b);
fd2=open(tty,O_RDWR);
with :
if ((c->fd = getPtyMaster(&fd2))<0)
{
log(LOG_WARN, "%s: unable to allocate pty, abandoning!\n",__FUNCTION__);
return -EINVAL;
}