Discussion:
ifconfig -a error
(too old to reply)
Iain Hibbert
2008-08-04 22:11:00 UTC
Permalink
Hi,

with the new ifconfig (on i386) I notice an error

% ifconfig -a
eon0: flags=3<UP,BROADCAST> mtu 1500
ifconfig: link_status: ioctl: Invalid argument

% ifconfig eon0
eon0: flags=3<UP,BROADCAST> mtu 1500
ifconfig: link_status: ioctl: Invalid argument

% ifconfig ppp0
ppp0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500
inet 10.34.129.29 -> 10.64.64.64 netmask 0xff000000

It seems to be related to the SIOCGLIFADDR in af_link.c but I don't know
what that does. I have "options EON,ISO,TPIP" in my kernel config file
(though I don't use the eon interface) left over from when I was working
in the netiso code so perhaps its an incompatibility with the eon driver?

iain

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Ignatios Souvatzis
2008-08-05 05:45:26 UTC
Permalink
Post by Iain Hibbert
It seems to be related to the SIOCGLIFADDR in af_link.c but I don't know
what that does. I have "options EON,ISO,TPIP" in my kernel config file
(though I don't use the eon interface) left over from when I was working
in the netiso code so perhaps its an incompatibility with the eon driver?
That's what I suspect - I was about to do some tests today.

-is

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Iain Hibbert
2008-08-09 09:48:22 UTC
Permalink
Post by Iain Hibbert
with the new ifconfig (on i386) I notice an error
% ifconfig -a
eon0: flags=3<UP,BROADCAST> mtu 1500
ifconfig: link_status: ioctl: Invalid argument
% ifconfig eon0
eon0: flags=3<UP,BROADCAST> mtu 1500
ifconfig: link_status: ioctl: Invalid argument
% ifconfig ppp0
ppp0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500
inet 10.34.129.29 -> 10.64.64.64 netmask 0xff000000
It seems to be related to the SIOCGLIFADDR in af_link.c but I don't
know what that does. I have "options EON,ISO,TPIP" in my kernel config
file (though I don't use the eon interface) left over from when I was
working in the netiso code so perhaps its an incompatibility with the
eon driver?
There is a bug in eonioctl(). In eonioctl(), change the return value in
the 'default:' case from EINVAL to ENOTTY. This is just a stopgap fix.
This does not work btw; I still get the same error with ENOTTY. The EINVAL
is coming from link_proto.c/link_control() at

switch (cmd) {
case SIOCALIFADDR:
case SIOCDLIFADDR:
case SIOCGLIFADDR:
iflr = data;

if (iflr->addr.ss_family != AF_LINK)
return EINVAL;

asdl = satocsdl(sstocsa(&iflr->addr));

if (asdl->sdl_alen != ifp->if_addrlen)
return EINVAL;

how to fix that?

iain


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Ignatios Souvatzis
2008-08-10 07:58:24 UTC
Permalink
Post by Iain Hibbert
This does not work btw; I still get the same error with ENOTTY. The EINVAL
is coming from link_proto.c/link_control() at
switch (cmd) {
(...)
Post by Iain Hibbert
how to fix that?
David, can you explicitly write up what ifconfig expects to be
implemented by the "hardware" network drivers?

-is
--
seal your e-mail: http://www.gnupg.org/

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
David Young
2008-08-05 17:11:07 UTC
Permalink
Post by Iain Hibbert
Hi,
with the new ifconfig (on i386) I notice an error
% ifconfig -a
eon0: flags=3<UP,BROADCAST> mtu 1500
ifconfig: link_status: ioctl: Invalid argument
% ifconfig eon0
eon0: flags=3<UP,BROADCAST> mtu 1500
ifconfig: link_status: ioctl: Invalid argument
% ifconfig ppp0
ppp0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500
inet 10.34.129.29 -> 10.64.64.64 netmask 0xff000000
It seems to be related to the SIOCGLIFADDR in af_link.c but I don't know
what that does. I have "options EON,ISO,TPIP" in my kernel config file
(though I don't use the eon interface) left over from when I was working
in the netiso code so perhaps its an incompatibility with the eon driver?
There is a bug in eonioctl(). In eonioctl(), change the return value
in the 'default:' case from EINVAL to ENOTTY. This is just a stopgap fix.

Dave
--
David Young OJC Technologies
***@ojctech.com Urbana, IL * (217) 278-3933 ext 24

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Iain Hibbert
2008-08-13 08:57:35 UTC
Permalink
Post by Iain Hibbert
with the new ifconfig (on i386) I notice an error
% ifconfig -a
eon0: flags=3<UP,BROADCAST> mtu 1500
ifconfig: link_status: ioctl: Invalid argument
with the following patch

--- /usr/src/sys/netiso/if_eon.c 2008-06-20 17:32:11.000000000 +0100
+++ if_eon.c 2008-08-13 09:36:55.000000000 +0100
@@ -135,6 +135,7 @@ void
eonattach(void)
{
struct ifnet *ifp = eonif;
+ uint8_t lla[] = { 0x00, 0x00, 0x00, 0x00, 0x00 };

#ifdef ARGO_DEBUG
if (argo_debug[D_EON]) {
@@ -153,7 +154,7 @@ eonattach(void)
ifp->if_hdrlen = EONIPLEN;
ifp->if_flags = IFF_BROADCAST;
if_attach(ifp);
- if_alloc_sadl(ifp);
+ if_set_sadl(ifp, lla, sizeof(lla));
eonioctl(ifp, SIOCSIFADDR, ifp->if_dl);
eon_llinfo.el_qhdr.link =
eon_llinfo.el_qhdr.rlink = &(eon_llinfo.el_qhdr);

then the ifconfig proceeds thus:

% ifconfig eon0
eon0: flags=3<UP,BROADCAST> mtu 1500
address: 00:00:00:00:00

now, clearly this is not right but it indicates that eonattach is not
setting the address properly. What is the eon address supposed to be?

The SIOCSIFADDR ioctl doesn't actually set any address, it just marks the
interface as up (seems wrong :). I don't see any documentation about eon
(weirdly, a commented out ".Xr eon 5" line in ifconfig.8), are there any
users? (is?)

iain

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
David Young
2008-08-13 16:03:27 UTC
Permalink
Post by Iain Hibbert
Post by Iain Hibbert
with the new ifconfig (on i386) I notice an error
% ifconfig -a
eon0: flags=3<UP,BROADCAST> mtu 1500
ifconfig: link_status: ioctl: Invalid argument
with the following patch
--- /usr/src/sys/netiso/if_eon.c 2008-06-20 17:32:11.000000000 +0100
+++ if_eon.c 2008-08-13 09:36:55.000000000 +0100
@@ -135,6 +135,7 @@ void
eonattach(void)
{
struct ifnet *ifp = eonif;
+ uint8_t lla[] = { 0x00, 0x00, 0x00, 0x00, 0x00 };
#ifdef ARGO_DEBUG
if (argo_debug[D_EON]) {
@@ -153,7 +154,7 @@ eonattach(void)
ifp->if_hdrlen = EONIPLEN;
ifp->if_flags = IFF_BROADCAST;
if_attach(ifp);
- if_alloc_sadl(ifp);
+ if_set_sadl(ifp, lla, sizeof(lla));
eonioctl(ifp, SIOCSIFADDR, ifp->if_dl);
eon_llinfo.el_qhdr.link =
eon_llinfo.el_qhdr.rlink = &(eon_llinfo.el_qhdr);
% ifconfig eon0
eon0: flags=3<UP,BROADCAST> mtu 1500
address: 00:00:00:00:00
now, clearly this is not right but it indicates that eonattach is not
setting the address properly. What is the eon address supposed to be?
The link-layer address on an eon(4) instance only holds the instance
name. A gre(4) also has a lladdr, but gre(4) also sets if_addrlen to 0.
Maybe eon(4) should do the same?
Post by Iain Hibbert
The SIOCSIFADDR ioctl doesn't actually set any address, it just marks the
interface as up (seems wrong :).
Many drivers' ioctl code is misleading in this way. Sometimes a
SIOCSIFADDR is not a SIOCSIFADDR! The kernel abuses the command constant
SIOCSIFADDR to pass an ifaddr (not an ifreq, mind you!) from the protocols
to the drivers. (I have fixed this in my tree by introducing a new ioctl,
SIOCINITIFADDR.) The work of setting an address is done by iso_control()
and iso_ifinit().
Post by Iain Hibbert
I don't see any documentation about eon
I don't think that documentation exists in the manual.

Dave
--
David Young OJC Technologies
***@ojctech.com Urbana, IL * (217) 278-3933 ext 24

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Ignatios Souvatzis
2008-08-13 17:01:30 UTC
Permalink
Post by David Young
Post by Iain Hibbert
% ifconfig eon0
eon0: flags=3<UP,BROADCAST> mtu 1500
address: 00:00:00:00:00
now, clearly this is not right but it indicates that eonattach is not
setting the address properly. What is the eon address supposed to be?
The link-layer address on an eon(4) instance only holds the instance
name. A gre(4) also has a lladdr, but gre(4) also sets if_addrlen to 0.
Maybe eon(4) should do the same?
eon(RFC 1070) is, basically, ISO CLNL encapsulated (with a small header for
flags) inside IPv4 - indeed similar to gre, gif etc. In fact, gif has some
incomplete eon handling code.

So, logically, the ll addr is the (outer) IPv4 address. How *should*
it do this / what do the others do?

(And should it, maybe, be replaced by some glue in gif?)

-is
--
seal your e-mail: http://www.gnupg.org/

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
David Young
2008-08-13 17:14:34 UTC
Permalink
Post by Ignatios Souvatzis
Post by David Young
Post by Iain Hibbert
% ifconfig eon0
eon0: flags=3<UP,BROADCAST> mtu 1500
address: 00:00:00:00:00
now, clearly this is not right but it indicates that eonattach is not
setting the address properly. What is the eon address supposed to be?
The link-layer address on an eon(4) instance only holds the instance
name. A gre(4) also has a lladdr, but gre(4) also sets if_addrlen to 0.
Maybe eon(4) should do the same?
eon(RFC 1070) is, basically, ISO CLNL encapsulated (with a small header for
flags) inside IPv4 - indeed similar to gre, gif etc. In fact, gif has some
incomplete eon handling code.
So, logically, the ll addr is the (outer) IPv4 address. How *should*
it do this / what do the others do?
I think that eon should set if_addrlen to 0.
Post by Ignatios Souvatzis
(And should it, maybe, be replaced by some glue in gif?)
The answer is "yes" in the short term, perhaps. In the long term, eon,
etherip, gif, and gre should become personalities of a generic tunnel
pseudo-interface that is extracted from gre.

Dave
--
David Young OJC Technologies
***@ojctech.com Urbana, IL * (217) 278-3933 ext 24

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Iain Hibbert
2008-08-13 19:02:34 UTC
Permalink
Post by David Young
Post by Ignatios Souvatzis
So, logically, the ll addr is the (outer) IPv4 address. How *should*
it do this / what do the others do?
I think that eon should set if_addrlen to 0.
I can confirm that solves the ifconfig trouble (it prints no address since
nothing is configured).

iain

--- /usr/src/sys/netiso/if_eon.c 2008-06-20 17:32:11.000000000 +0100
+++ sys/netiso/if_eon.c 2008-08-13 19:21:48.000000000 +0100
@@ -149,7 +149,7 @@ eonattach(void)
ifp->if_ioctl = eonioctl;
ifp->if_output = eonoutput;
ifp->if_type = IFT_EON;
- ifp->if_addrlen = 5;
+ ifp->if_addrlen = 0;
ifp->if_hdrlen = EONIPLEN;
ifp->if_flags = IFF_BROADCAST;
if_attach(ifp);

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