* pppd don't create ppp-network-device
2004-09-10 12:46 pppd don't create ppp-network-device p.boehm
2004-09-10 16:02 ` Bill Unruh
@ 2004-09-15 14:14 ` p.boehm
2004-09-15 14:33 ` carlsonj
2 siblings, 0 replies; 4+ messages in thread
From: p.boehm @ 2004-09-15 14:14 UTC (permalink / raw)
To: linux-ppp
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1254", Size: 15394 bytes --]
I ask me why ppp does not create a new ppp-device, although it starts correctly (automatically
loaded into
kernel after start of pppd):
/var/log/messages:
...
Sep 10 09:55:46 nano kernel: PPP generic driver version 2.4.1
...
please see the following part of a strace:
# --- can be ignored --- see further below ...
# getting infos from some ppp-config-files
1206 open("/etc/ppp/options", O_RDONLY) = 4
1206 fstat64(4, {st_dev=makedev(3, 7), st_inoB533, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0,
st_gid=0, st_blksize@96, st_blocks\x16, st_sizey53, st_atime 04/09/11-20:19:08,
st_mtime 04/09/10-16:38:21, st_ctime 04/09/10-16:38:21}) = 0
1206 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40016000
1206 read(4, "# /etc/ppp/options\n# \n# Not ever"..., 4096) = 4096
1206 stat64("/dev/ttyS0", {st_dev=makedev(3, 7), st_ino07, st_mode=S_IFCHR|0660, st_nlink=1,
st_uid=0, st_gid\x14, st_blksize@96, st_blocks=0, st_rdev=makedev(4, 64),
st_atime 04/09/11-20:07:45, st_mtime 04/09/11-20:18:09, st_ctime 04/02/27-09:03:45}) = 0
1206 stat64("/dev/ttyS0", {st_dev=makedev(3, 7), st_ino07, st_mode=S_IFCHR|0660, st_nlink=1,
st_uid=0, st_gid\x14, st_blksize@96, st_blocks=0, st_rdev=makedev(4, 64),
st_atime 04/09/11-20:07:45, st_mtime 04/09/11-20:18:09, st_ctime 04/02/27-09:03:45}) = 0
1206 read(4, "erface.\n#mtu <n>\n\n# Set the inte"..., 4096) = 3857
1206 read(4, "", 4096) = 0
1206 close(4) = 0
1206 munmap(0x40016000, 4096) = 0
1206 getuid32() = 0
1206 brk(0x8087000) = 0x8087000
1206 socket(PF_UNIX, SOCK_STREAM, 0) = 4
1206 connect(4, {sin_family¯_UNIX, path="/var/run/.nscd_socket"}, 110) = 0
1206 write(4, "\x02\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00", 12) = 12
1206 write(4, "\x30\x00", 2) = 2
1206 read(4, "\x90\xc1\x16\x40\x01\x00\x00\x00\x05\x00\x00\x00\x02\x00"..., 36) = 36
1206 read(4, "\x72\x6f\x6f\x74\x00\x78\x00\x72\x6f\x6f\x74\x00\x2f\x72"..., 28) = 28
1206 close(4) = 0
1206 getuid32() = 0
1206 setresuid32(0xffffffff, 0, 0xffffffff) = 0
1206 open("/root/.ppprc", O_RDONLY) = -1 ENOENT (No such file or directory)
1206 setresuid32(0xffffffff, 0, 0xffffffff) = 0
1206 getuid32() = 0
1206 setresuid32(0xffffffff, 0, 0xffffffff) = 0
1206 open("/etc/ppp/peers/isp", O_RDONLY) = 4
1206 setresuid32(0xffffffff, 0, 0xffffffff) = 0
1206 fstat64(4, {st_dev=makedev(3, 7), st_ino\x138957, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0,
st_gid=0, st_blksize@96, st_blocks=8, st_sizei, st_atime 04/09/11-20:19:18,
st_mtime 04/09/11-20:19:36, st_ctime 04/09/11-20:19:36}) = 0
1206 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40016000
1206 read(4, "ttyS0 19200 crtscts\nconnect \'/us"..., 4096) = 69
1206 stat64("/dev/ttyS0", {st_dev=makedev(3, 7), st_ino07, st_mode=S_IFCHR|0660, st_nlink=1,
st_uid=0, st_gid\x14, st_blksize@96, st_blocks=0, st_rdev=makedev(4, 64),
st_atime 04/09/11-20:07:45, st_mtime 04/09/11-20:18:09, st_ctime 04/02/27-09:03:45}) = 0
1206 stat64("/dev/ttyS0", {st_dev=makedev(3, 7), st_ino07, st_mode=S_IFCHR|0660, st_nlink=1,
st_uid=0, st_gid\x14, st_blksize@96, st_blocks=0, st_rdev=makedev(4, 64),
st_atime 04/09/11-20:07:45, st_mtime 04/09/11-20:18:09, st_ctime 04/02/27-09:03:45}) = 0
1206 stat64("/dev/19200", 0xbfffdd5c) = -1 ENOENT (No such file or directory)
1206 read(4, "", 4096) = 0
1206 close(4) = 0
1206 munmap(0x40016000, 4096) = 0
1206 open("/etc/ppp/options.ttyS0", O_RDONLY) = 4
1206 fstat64(4, {st_dev=makedev(3, 7), st_ino\x106613, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0,
st_gid=0, st_blksize@96, st_blocks=8, st_sizeG0, st_atime 04/09/11-20:19:06,
st_mtime 04/09/10-13:38:22, st_ctime 04/09/10-13:41:08}) = 0
1206 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40016000
1206 read(4, "# If you need to set up multiple"..., 4096) = 470
1206 stat64("/dev/0.0.0.0:192.168.1.44", 0xbfffddcc) = -1 ENOENT (No such file or directory)
1206 read(4, "", 4096) = 0
1206 close(4) = 0
1206 munmap(0x40016000, 4096) = 0
1206 geteuid32() = 0
1206 uname({sysname="Linux", nodename="nano", release="2.4.10-4GB", version="#1 Thu Jun 17 12:56:02
CEST 2004", machine="i686"}) = 0
)
# --- end of part that can be ignored ---
# ok. let's take a look
# check if /dev/ppp can be accessed ...
1206 open("/dev/ppp", O_RDWR) = 4
1206 close(4) = 0
# ok. it works.
1206 fstat64(0, {st_dev=makedev(3, 7), st_inoy64, st_mode=S_IFCHR|0620, st_nlink=1, st_uid=0,
st_gid=5, st_blksize@96, st_blocks=0, st_rdev=makedev(4, 1), st_atime 04/09/11-20:19:41,
st_mtime 04/09/11-20:19:41, st_ctime 04/09/11-20:01:34}) = 0
1206 fstat64(1, {st_dev=makedev(3, 7), st_inoy64, st_mode=S_IFCHR|0620, st_nlink=1, st_uid=0,
st_gid=5, st_blksize@96, st_blocks=0, st_rdev=makedev(4, 1), st_atime 04/09/11-20:19:41,
st_mtime 04/09/11-20:19:41, st_ctime 04/09/11-20:01:34}) = 0
# open /dev/ppp an getting/setting flags ...
1206 open("/dev/ppp", O_RDWR) = 4
1206 fcntl64(4, F_GETFL) = 0x2 (flags O_RDWR)
1206 fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0
# create an IP-Socket ...
1206 socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 5
# open pppd-Database ...
1206 open("/var/run/pppd.tdb", O_RDWR|O_CREAT, 0644) = 6
# ...and looking for something what I dont't know ... (does you?)
1206 fcntl64(6, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start=0, len=1}) = 0
1206 fcntl64(6, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=4, len=1}) = 0
1206 read(6, "\x54\x44\x42\x20\x66\x69\x6c\x65\x0a\x00\x00\x00\x00\x00"..., 40) = 40
1206 fstat64(6, {st_dev=makedev(3, 7), st_ino\x106973, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0,
st_gid\x16, st_blksize@96, st_blocks\x16, st_size92, st_atime 04/09/11-20:19:41,
st_mtime 04/09/11-20:02:08, st_ctime 04/09/11-20:02:08}) = 0
1206 old_mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_SHARED, 6, 0) = 0x40016000
1206 fcntl64(6, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=1}) = 0
1206 getpid() = 1206
1206 fcntl64(6, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start\x1524, len=1}) = 0
1206 fcntl64(6, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start\x1524, len=1}) = 0
1206 fcntl64(6, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start\x1020, len=1}) = 0
1206 fcntl64(6, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start\x1020, len=1}) = 0
1206 fcntl64(6, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start\x1524, len=1}) = 0
1206 fcntl64(6, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start\x1524, len=1}) = 0
# seems that nothing was not found.
# child process to run chat ...
1206 fork() = 1207
# some output from chat ...
1207 setsid() = 1207
1207 chdir("/") = 0
1207 close(0) = 0
1207 close(1) = 0
1207 close(2) = 0
1207 getpid() = 1207
1207 fcntl64(6, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start\x1288, len=1}) = 0
1207 fcntl64(6, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start\x1288, len=1}) = 0
1207 fcntl64(6, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start\x1020, len=1}) = 0
1207 fcntl64(6, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start\x1020, len=1}) = 0
1207 fcntl64(6, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start\x1288, len=1}) = 0
1207 fcntl64(6, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start\x1288, len=1}) = 0
1207 fcntl64(6, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start\x1524, len=1}) = 0
1207 fcntl64(6, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start\x1524, len=1}) = 0
1207 ioctl(0, SNDCTL_TMR_TIMEBASE, 0xbffff108) = -1 EBADF (Bad file descriptor)
1207 socket(PF_UNIX, SOCK_STREAM, 0) = 0
1207 connect(0, {sin_family¯_UNIX, path="/var/run/.nscd_socket"}, 110) = 0
1207 write(0, "\x02\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00", 12) = 12
1207 write(0, "\x30\x00", 2) = 2
1207 read(0, "\x90\xc1\x16\x40\x01\x00\x00\x00\x05\x00\x00\x00\x02\x00"..., 36) = 36
1207 read(0, "\x72\x6f\x6f\x74\x00\x78\x00\x72\x6f\x6f\x74\x00\x2f\x72"..., 28) = 28
1207 close(0) = 0
1207 brk(0x808a000) = 0x808a000
1207 time([1094926781]) = 1094926781
1207 open("/etc/localtime", O_RDONLY) = 0
1207 fstat64(0, {st_dev=makedev(3, 7), st_ino\x19136, st_mode=S_IFREG|0644, st_nlink=2, st_uid=0,
st_gid=0, st_blksize@96, st_blocks=8, st_size7, st_atime 04/09/11-20:19:41,
st_mtime 01/09/20-05:29:16, st_ctime 04/09/11-20:00:41}) = 0
1207 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40018000
1207 read(0, "\x54\x5a\x69\x66\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 4096) = 837
1207 close(0) = 0
1207 munmap(0x40018000, 4096) = 0
1207 getpid() = 1207
1207 rt_sigaction(SIGPIPE, {0x40133e20, [], 0x4000000}, {SIG_DFL}, 8) = 0
1207 send(3, "<149>Sep 11 20:19:41 pppd[1207]:"..., 66, 0) = 66
1207 rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
1207 fcntl64(6, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start\x1524, len=1}) = 0
1207 fcntl64(6, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start\x1524, len=1}) = 0
1207 fcntl64(6, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start\x1248, len=1}) = 0
1207 fcntl64(6, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start\x1248, len=1}) = 0
# ... and pppd dies. (w/o any errors)
1206 _exit(0) = ?
In kernel-config CONFIG_PPP Switches are set (as modules) and will supported by my kernel (out of
CONFIG_PPP_MULTILINK)
Any ideas where the problem could be? Or how I can find it?
Currently I study the ppp_generic sources to understand how it works, and that's my study-results so
far ...
1) loading ppp_generic ...
int init_module(void)
/* ----------------- register_chrdev just fills ppp_file-structure -------------------- */
register_chrdev(108, "ppp",&ppp_fops);
/* ----------------- no error ----------------------------------------------------------*/
2) wait for ioctl-requests ...
static int ppp_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
struct ppp_file *pf = (struct ppp_file *) file->private_data;
...
if (pf = 0)
return ppp_unattached_ioctl(pf, file, cmd, arg);
...
3) in ppp_unattached_ioctl ...
static int ppp_unattached_ioctl(struct ppp_file *pf, struct file *file,
unsigned int cmd, unsigned long arg)
{
int unit, err = -EFAULT;
struct ppp *ppp;
struct channel *chan;
...
case PPPIOCNEWUNIT:
/* Create a new ppp unit */
/* ----------- a possibility to fly out -------------------------- */
if (get_user(unit, (int *) arg))
break;
/* ----------- retval would be -EFAULT. but it isn't ------------- */
ppp = ppp_create_interface(unit, &err); /* <--- !!! */
if (ppp = 0)
break;
file->private_data = &ppp->file;
err = -EFAULT;
if (put_user(ppp->file.index, (int *) arg))
break;
err = 0;
break;
...
default:
/* ----------- no ioctl-request matched -------------------------- */
err = -ENOTTY;
/* ----------- retval would be -ENOTTY but it isnt't ------------- */
} /* case */
return err;
4) in ppp_create_interface ...
static struct ppp *ppp_create_interface(int unit, int *retp)
{
struct ppp *ppp;
struct net_device *dev;
struct list_head *list;
int last_unit = -1;
int ret = -EEXIST;
int i;
spin_lock(&all_ppp_lock);
list = &all_ppp_units;
while ((list = list->next) != &all_ppp_units) {
ppp = list_entry(list, struct ppp, file.list);
if ((unit < 0 && ppp->file.index > last_unit + 1)
|| (unit >= 0 && unit < ppp->file.index))
break;
/* --------------- 1st possibility to fly out ... --------------------- */
if (unit = ppp->file.index)
goto out; /* unit already exists */
/* --------------- unit does not exists ------------------------------- */
last_unit = ppp->file.index;
}
if (unit < 0)
unit = last_unit + 1;
/* Create a new ppp structure and link it before `list'. */
ret = -ENOMEM;
ppp = kmalloc(sizeof(struct ppp), GFP_KERNEL);
/* ---------------- 2nd possibility to fly out ... -------------------- */
if (ppp = 0)
goto out;
/* ---------------- but there's space enough -------------------------- */
memset(ppp, 0, sizeof(struct ppp));
dev = kmalloc(sizeof(struct net_device), GFP_KERNEL);
/* ---------------- 3rd possibility to fly out ... -------------------- */
if (dev = 0) {
kfree(ppp);
goto out;
}
/* ---------------- but there's space enough -------------------------- */
memset(dev, 0, sizeof(struct net_device));
ppp->file.index = unit;
ppp->mru = PPP_MRU;
init_ppp_file(&ppp->file, INTERFACE);
ppp->file.hdrlen = PPP_HDRLEN - 2; /* don't count proto bytes */
for (i = 0; i < NUM_NP; ++i)
ppp->npmode[i] = NPMODE_PASS;
INIT_LIST_HEAD(&ppp->channels);
spin_lock_init(&ppp->rlock);
spin_lock_init(&ppp->wlock);
#ifdef CONFIG_PPP_MULTILINK
ppp->minseq = -1;
skb_queue_head_init(&ppp->mrq);
#endif /* CONFIG_PPP_MULTILINK */
ppp->dev = dev;
dev->init = ppp_net_init;
sprintf(dev->name, "ppp%d", unit);
dev->priv = ppp;
dev->features |= NETIF_F_DYNALLOC;
rtnl_lock();
ret = register_netdevice(dev);
rtnl_unlock();
/* --------- 4th possibility to fly out. ------------------ */
if (ret != 0) {
printk(KERN_ERR "PPP: couldn't register device (%d)\n", ret);
kfree(dev);
kfree(ppp);
goto out;
}
/* --------- but syslog has never received it ... --------- */
list_add(&ppp->file.list, list->prev);
out:
spin_unlock(&all_ppp_lock);
*retp = ret;
if (ret != 0)
ppp = 0;
return ppp;
}
If you compare with trace-output: there is no reason to see why ppp0-device shouldn't be created.
May be I have some important hints not saw ???
Hope someone can help me!
Thanks in advance!
pb
-
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread