Discussion:
pppoectl(8) with COMPAT_NETBSD32
(too old to reply)
Roy Marples
2015-05-31 15:18:27 UTC
Permalink
Hi List

Attached is a patch which should make pppoectl work with COMPAT_NETBSD32
to make my erlite happy, but it's failing with the PPPOESETPARMS ioctl.
Infact, it doesn't even make it into the kernel as the call bails out
with a Inappropriate ioctl for device error, but I don't easily see
what's wrong!

Anyone have a better clue than me?

Thanks

Roy
Martin Husemann
2015-05-31 18:45:02 UTC
Permalink
Post by Roy Marples
Hi List
Attached is a patch which should make pppoectl work with COMPAT_NETBSD32
to make my erlite happy, but it's failing with the PPPOESETPARMS ioctl.
Infact, it doesn't even make it into the kernel as the call bails out
with a Inappropriate ioctl for device error, but I don't easily see
what's wrong!
Anyone have a better clue than me?
+/* from net/if_pppoe.h */
+struct netbsd32_pppoediscparms {
+ char ifname[IFNAMSIZ]; /* pppoe interface name */
+ char eth_ifname[IFNAMSIZ]; /* external ethernet interface name */
+ netbsd32_charp ac_name; /* access concentrator name (or NULL) */
+ size_t ac_name_len; /* on write: length of buffer for ac_name */
+ netbsd32_charp service_name; /* service name (or NULL) */
+ size_t service_name_len; /* on write: length of buffer for service name */

size_t needs to be netbsd32_size_t?

To catch things like this positively, verify that sizeof(...parms) in userland
matches sizeof(netbsd32_....) in kernel.


Martin

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Roy Marples
2015-05-31 19:34:05 UTC
Permalink
Post by Martin Husemann
Post by Roy Marples
Hi List
Attached is a patch which should make pppoectl work with
COMPAT_NETBSD32
to make my erlite happy, but it's failing with the PPPOESETPARMS ioctl.
Infact, it doesn't even make it into the kernel as the call bails out
with a Inappropriate ioctl for device error, but I don't easily see
what's wrong!
Anyone have a better clue than me?
+/* from net/if_pppoe.h */
+struct netbsd32_pppoediscparms {
+ char ifname[IFNAMSIZ]; /* pppoe interface name */
+ char eth_ifname[IFNAMSIZ]; /* external ethernet interface name */
+ netbsd32_charp ac_name; /* access concentrator name (or NULL) */
+ size_t ac_name_len; /* on write: length of buffer for ac_name */
+ netbsd32_charp service_name; /* service name (or NULL) */
+ size_t service_name_len; /* on write: length of buffer for service name */
size_t needs to be netbsd32_size_t?
Doh!

pppoectl looks fine now, thanks!

Roy

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Matt Thomas
2015-05-31 18:23:02 UTC
Permalink
Attached is a patch which should make pppoectl work with COMPAT_NETBSD32 to make my erlite happy, but it's failing with the PPPOESETPARMS ioctl.
Infact, it doesn't even make it into the kernel as the call bails out with a Inappropriate ioctl for device error, but I don't easily see what's wrong!
Anyone have a better clue than me?
You can’t use size_t, instead use netbsd32_size_t, in the compat structures.
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...