Discussion:
pppoectl(8) -d won't work
(too old to reply)
Holger Weiss
2007-08-19 23:25:34 UTC
Permalink
On 4.99.28/sparc64, my pppoe(4) connection works just fine (apart from
the fact that IPv6 negotiation fails while it works with rp-pppoe, but I
guess that's another story---which I haven't looked into yet):

| $ ifconfig pppoe0
| pppoe0: flags=8851<UP,POINTOPOINT,RUNNING,SIMPLEX,MULTICAST> mtu 1424
| inet 217.197.85.252 -> 192.109.42.188 netmask 0xff000000
| inet6 fe80::a00:20ff:feac:1643%pppoe0 -> prefixlen 64 scopeid 0x4

However:

| $ pppoectl -d pppoe0
| pppoe0: interface not found

To get the session state, pppoectl(8) does an ioctl(2) call with a
PPPOEGETSESSION request, which should be handled by pppoe(4)'s
pppoe_ioctl(). PPPOEGETSESSION evaluates to 3223349616. However, I
added some debug output to sys/net/if_pppoe.c and for some reason,
pppoe_ioctl() receives 3230689648 via its "cmd" argument. Therefore,
the call isn't caught by the PPPOEGETSESSION case within pppoe_ioctl().
Instead, it's handled by the default case, which hands it over to
sys/net/if_spppsubr.c:sppp_ioctl(), which in turn returns ENOTTY.

I didn't use pppoe(4) before, so I don't know whether this problem is
new. Can others reproduce it? Any ideas?

Holger

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Michael van Elst
2007-08-20 06:26:47 UTC
Permalink
[...] PPPOEGETSESSION evaluates to 3223349616. However, I
added some debug output to sys/net/if_pppoe.c and for some reason,
pppoe_ioctl() receives 3230689648 via its "cmd" argument.
That's both PPPOEGETSESSION, once with a 32 byte argument, once
with a 144 byte argument. Clearly kernel and userland are out
of sync regarding sizeof(struct pppoeconnectionstate).
--
--
Michael van Elst
Internet: ***@serpens.de
"A potential Snark may lurk in every tree."

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Martin Husemann
2007-08-20 08:06:42 UTC
Permalink
Post by Michael van Elst
That's both PPPOEGETSESSION, once with a 32 byte argument, once
with a 144 byte argument. Clearly kernel and userland are out
of sync regarding sizeof(struct pppoeconnectionstate).
... and someone borked ioctl compatibility (probably a change to IFNAMSIZ).


On my sparc64 running 4.0_BETA2 I get:

pppoe0: state = session
Session ID: 0x16eb
PADI retries: 21
PADR retries: 0


Martin

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Holger Weiss
2007-08-20 13:24:05 UTC
Permalink
Post by Martin Husemann
Post by Michael van Elst
That's both PPPOEGETSESSION, once with a 32 byte argument, once
with a 144 byte argument. Clearly kernel and userland are out
of sync regarding sizeof(struct pppoeconnectionstate).
... and someone borked ioctl compatibility (probably a change to IFNAMSIZ).
I should've mentioned that PPPOEGETSESSION evaluates to 3223349616 on
_both_ sides. That is, replacing the PPPOEGETSESSION macro with the
hardcoded value 3223349616UL within both the ioctl(2) call and
pppoe_ioctl()'s switch case doesn't change anything.

Holger


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Martin Husemann
2007-08-20 13:38:26 UTC
Permalink
Post by Holger Weiss
I should've mentioned that PPPOEGETSESSION evaluates to 3223349616 on
_both_ sides. That is, replacing the PPPOEGETSESSION macro with the
hardcoded value 3223349616UL within both the ioctl(2) call and
pppoe_ioctl()'s switch case doesn't change anything.
What does ktrace say?

4883 1 pppoectl CALL ioctl(3,PPPOEGETSESSION,0xffffffffffffc694)
4883 1 pppoectl GIO fd 3 wrote 32 bytes
"pppoe0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4883 1 pppoectl GIO fd 3 read 32 bytes
"pppoe0\0\0\0\0\0\0\0\0\0\0\0\0\0\^C\0\0\v\M-W\0\0\0\^U\0\0\0\0"
4883 1 pppoectl RET ioctl 0, 3223349616/0xc0206970

is what I get. Corresponding kdump -n:

4883 1 pppoectl CALL ioctl(3,0xc0206970,0xffffffffffffc694)
4883 1 pppoectl GIO fd 3 wrote 32 bytes
"pppoe0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4883 1 pppoectl GIO fd 3 read 32 bytes
"pppoe0\0\0\0\0\0\0\0\0\0\0\0\0\0\^C\0\0\v\M-W\0\0\0\^U\0\0\0\0"
4883 1 pppoectl RET ioctl 0, 0xc0206970


Martin

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Holger Weiss
2007-08-20 13:53:59 UTC
Permalink
Post by Martin Husemann
Post by Holger Weiss
I should've mentioned that PPPOEGETSESSION evaluates to 3223349616 on
_both_ sides. That is, replacing the PPPOEGETSESSION macro with the
hardcoded value 3223349616UL within both the ioctl(2) call and
pppoe_ioctl()'s switch case doesn't change anything.
What does ktrace say?
4883 1 pppoectl CALL ioctl(3,PPPOEGETSESSION,0xffffffffffffc694)
4883 1 pppoectl GIO fd 3 wrote 32 bytes
"pppoe0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4883 1 pppoectl GIO fd 3 read 32 bytes
"pppoe0\0\0\0\0\0\0\0\0\0\0\0\0\0\^C\0\0\v\M-W\0\0\0\^U\0\0\0\0"
4883 1 pppoectl RET ioctl 0, 3223349616/0xc0206970
is what I get.
I get:

568 1 pppoectl CALL ioctl(3,PPPOEGETSESSION,0xffffffffffffc4c0)
568 1 pppoectl GIO fd 3 wrote 32 bytes
"pppoe0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
568 1 pppoectl RET ioctl -1 errno 25 Inappropriate ioctl for device
Post by Martin Husemann
4883 1 pppoectl CALL ioctl(3,0xc0206970,0xffffffffffffc694)
4883 1 pppoectl GIO fd 3 wrote 32 bytes
"pppoe0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4883 1 pppoectl GIO fd 3 read 32 bytes
"pppoe0\0\0\0\0\0\0\0\0\0\0\0\0\0\^C\0\0\v\M-W\0\0\0\^U\0\0\0\0"
4883 1 pppoectl RET ioctl 0, 0xc0206970
568 1 pppoectl CALL ioctl(3,0xc0206970,0xffffffffffffc4c0)
568 1 pppoectl GIO fd 3 wrote 32 bytes
"pppoe0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
568 1 pppoectl RET ioctl -1 errno 25

Holger


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Martin Husemann
2007-08-20 15:39:13 UTC
Permalink
Post by Holger Weiss
568 1 pppoectl CALL ioctl(3,0xc0206970,0xffffffffffffc4c0)
568 1 pppoectl GIO fd 3 wrote 32 bytes
"pppoe0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
568 1 pppoectl RET ioctl -1 errno 25
So the problem is in the kernel.

And indeed it seems struct ifreq changed size, and all the few dozen
ioctls using that have not been versioned.

Martin

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Martin Husemann
2007-08-20 16:49:56 UTC
Permalink
Post by Martin Husemann
They have - but the versioning is broken right now (and I'm not sure that
is related to your problem, as struct pppoeconnectionstate did not change
it's size, and if you would run into this problem, you could not even
create pppoe0)
Ok, I fixed the versioning code, and now am able to reproduce your problem.

Martin

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Martin Husemann
2007-08-20 16:27:28 UTC
Permalink
Post by Martin Husemann
And indeed it seems struct ifreq changed size, and all the few dozen
ioctls using that have not been versioned.
They have - but the versioning is broken right now (and I'm not sure that
is related to your problem, as struct pppoeconnectionstate did not change
it's size, and if you would run into this problem, you could not even
create pppoe0)

Martin

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...