Re: dhclient problem with xl0

2003-08-14 Thread Martin Blapp

Hi,

 Here is the output of dhclient -v -d xl0

I I checked. Dhclient still initializes the
interface and brings it up itself. So there
is only one possibility:

You don't have a working link. Maybe it helps
if you add a interface define in /etc/dhclient.conf
wit the possible media.

Martin
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: dhclient problem with xl0

2003-08-14 Thread Matthew N. Dodd
On Sat, 9 Aug 2003, Martin Blapp wrote:
 Isn't there a way to see that the card doesn't support reporting
 media status ? If the card does report this, I could add code
 to dhclient and all would be fine.

Yes; check the media status word for IFM_AVALID.

(whitespace damaged)
%%%
--- dhclient.c  28 Jul 2003 13:25:04 -  1.27
+++ dhclient.c  9 Aug 2003 13:07:16 -
@@ -3221,13 +3221,11 @@
if (ifmr.ifm_status  IFM_ACTIVE)
return (1);
}
+   return (0);
}

-   return (0);
-#else /* ifdef __FreeBSD__ */
-
-   return (1);
 #endif /* Other OSs */
+   return (1);
 }

 #ifdef __FreeBSD__
%%%


-- 
| Matthew N. Dodd  | '78 Datsun 280Z | '75 Volvo 164E | FreeBSD/NetBSD  |
| [EMAIL PROTECTED] |   2 x '84 Volvo 245DL| ix86,sparc,pmax |
| http://www.jurai.net/~winter |  For Great Justice!  | ISO8802.5 4ever |
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: dhclient problem with xl0

2003-08-14 Thread Matthew N. Dodd
On Sat, 9 Aug 2003, Martin Blapp wrote:
  dhclient is still relying on behavior from the kernel that isn't
  guaranteed.

 I know. But I'd consider that as a kernel bug, not dhclient fault.
 Would it help the set the card into promisc. mode anyway, even
 if we don't have link ?

Except that you've added code to dhclient that makes poor assumptions
about the ifmedia status word.  Its optional; for hardware that you can
detect media status it can be used to display the status.  For other
hardware, we shouldn't have to lie about media status; if the hardware
doesn't support reporting media status then we shouldn't do anything with
the status word.

-- 
| Matthew N. Dodd  | '78 Datsun 280Z | '75 Volvo 164E | FreeBSD/NetBSD  |
| [EMAIL PROTECTED] |   2 x '84 Volvo 245DL| ix86,sparc,pmax |
| http://www.jurai.net/~winter |  For Great Justice!  | ISO8802.5 4ever |
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: dhclient problem with xl0

2003-08-14 Thread Martin Blapp

Argl, of course the patch was wrong. Ok, this should work
now ...

--- contrib/isc-dhcp/client/dhclient.c.orig Thu Aug  7 16:58:46 2003
+++ contrib/isc-dhcp/client/dhclient.c  Sat Aug  9 21:47:14 2003
@@ -3288,19 +3288,24 @@
return (HAVELINK);
}
}
+   /*
+* If dhclient.conf contains media settings, we cannot
+* abort if the interface is not set to active mode.
+*/
+   if (ip - havemedia  ip - client - state != S_BOUND)
+   return (HAVELINK);
+   } else {
+   /*
+* IFM_AVALID is not set. We cannot check
+* the link state. Assume HAVELINK.
+*/
+   return (HAVELINK);
}
-
-   /*
-* If dhclient.conf contains media settings, we cannot
-* abort if the interface is not set to active mode.
-*/
-   if (ip - havemedia  ip - client - state != S_BOUND)
-   return (HAVELINK);
-
/*
 * We really have no link.
 */
return (NOLINK);
+
 #else /* ifdef __FreeBSD__ */

/*
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: dhclient problem with xl0

2003-08-14 Thread Martin Blapp

Hi,

Adapted to the newst source-version, the patch will look like
this. After I got home, I'll test it.

Martin

Index: client/dhclient.c
===
RCS file: /home/ncvs/src/contrib/isc-dhcp/client/dhclient.c,v
retrieving revision 1.30
diff -u -r1.30 dhclient.c
--- client/dhclient.c   7 Aug 2003 14:58:46 -   1.30
+++ client/dhclient.c   9 Aug 2003 16:20:22 -
@@ -3288,19 +3288,21 @@
return (HAVELINK);
}
}
-   }

-   /*
-* If dhclient.conf contains media settings, we cannot
-* abort if the interface is not set to active mode.
-*/
-   if (ip - havemedia  ip - client - state != S_BOUND)
-   return (HAVELINK);
+   /*
+* If dhclient.conf contains media settings, we cannot
+* abort if the interface is not set to active mode.
+*/
+   if (ip - havemedia  ip - client - state != S_BOUND)
+   return (HAVELINK);

-   /*
-* We really have no link.
-*/
-   return (NOLINK);
+   /*
+* We really have no link.
+*/
+   return (NOLINK);
+   }
+
+   return (HAVELINK);
 #else /* ifdef __FreeBSD__ */

/*
@@ -3310,6 +3312,7 @@
return (HAVELINK);
 #endif /* Other OSs */
 }
+

 #ifdef __FreeBSD__
 void

Martin Blapp, [EMAIL PROTECTED] [EMAIL PROTECTED]
--
ImproWare AG, UNIXSP  ISP, Zurlindenstrasse 29, 4133 Pratteln, CH
Phone: +41 61 826 93 00 Fax: +41 61 826 93 01
PGP: finger -l [EMAIL PROTECTED]
PGP Fingerprint: B434 53FC C87C FE7B 0A18 B84C 8686 EF22 D300 551E
--

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: dhclient problem with xl0

2003-08-14 Thread Matthew N. Dodd
On Sat, 9 Aug 2003, Craig Rodrigues wrote:
 I just did a cvsup of -CURRENT and rebuilt the world.
 dhclient doesn't seem to work for me any more.
 It looks like a problem with dhclient, and not the
 kernel, because an older version of dhclient works fine.

 Here is the output of dhclient -v -d xl0

Try this (cut  paste):
%%%
Index: if_xl.c
===
RCS file: /cvs/src/sys/pci/if_xl.c,v
retrieving revision 1.150
diff -u -u -r1.150 if_xl.c
--- if_xl.c 27 Jul 2003 13:56:03 -  1.150
+++ if_xl.c 4 Aug 2003 15:46:36 -
@@ -3031,6 +3031,10 @@
icfg = XL_ICFG_CONNECTOR_BITS;

ifmr-ifm_active = IFM_ETHER;
+   ifmr-ifm_status = IFM_AVALID;
+
+   if (!(CSR_READ_2(sc, XL_W4_MEDIA_STATUS)  XL_MEDIASTAT_CARRIER))
+   ifmr-ifm_status |= IFM_ACTIVE;

switch(icfg) {
case XL_XCVR_10BT:
%%%

-- 
| Matthew N. Dodd  | '78 Datsun 280Z | '75 Volvo 164E | FreeBSD/NetBSD  |
| [EMAIL PROTECTED] |   2 x '84 Volvo 245DL| ix86,sparc,pmax |
| http://www.jurai.net/~winter |  For Great Justice!  | ISO8802.5 4ever |
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: dhclient problem with xl0

2003-08-14 Thread Martin Blapp

Hi,

 xl0: Polling interface state
 xl0: client state of 2
 xl0: link = 0
 xl0: No Link on interface

Erm. What does 'ifconfig xl0' show you ? For dhclient
it looks like you have no link.

Martin
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: dhclient problem with xl0

2003-08-14 Thread Craig Rodrigues
On Sat, Aug 09, 2003 at 06:21:43PM +0200, Martin Blapp wrote:
 
 Hi,
 
 Adapted to the newst source-version, the patch will look like
 this. After I got home, I'll test it.

OK, this is weird.  I did not use your change to dhclient.
However, I did use Matthew Dodd's change to if_xl.c.
I rebuilt the kernel, powered down, rebooted, and things seem
to work better.

Before Matthew's patch, ifconfig xl0 would never print out
status:

Now, ifconfig xl0, *always* prints out:
status: no carrier

even if I do have carrier.

If I run dhclient (without your patch, but with debugging), I get:

===
Internet Software Consortium DHCP Client V3.0.1rc1
Copyright 1995-2002 Internet Software Consortium
All rights reserved
For info, please visit http://www.isc.org/products/DHCP

Listening on BPF/xl0/00:60:97:72:ad:f0
Sending on   BPF/xl0/00:60:97:72:ad:f0
Sending on   Socket/fallback
xl0: Polling interface state
xl0: client state of 2
xl0: link = 0
xl0: No Link on interface
xl0: Polling interface state
xl0: client state of 2
xl0: link = 0
xl0: No Link on interface
xl0: Polling interface state
xl0: client state of 2
xl0: link = 0
xl0: No Link on interface
===


Now, if I add the following lines to /etc/dhclient.conf (I've never
had to modify this file before):
 
interface xl0 {
   media autoselect;
}

I then get the following from dhclient:
===

Script started on Sat Aug  9 13:11:42 2003
Internet Software Consortium DHCP Client V3.0.1rc11
Copyright 1995-2002 Internet Software Consortium.
All rights reserved.
For info, please visit http://www.isc.org/products/DHCP

Listening on BPF/xl0/00:60:97:72:ad:f0
Sending on   BPF/xl0/00:60:97:72:ad:f0
Sending on   Socket/fallback
xl0: Polling interface state
xl0: client state of 2
xl0: link = 0
xl0: Trying media settings on interface
DHCPREQUEST on xl0 to 255.255.255.255 port 67
DHCPACK from 10.208.128.1
bound to 66.31.45.197 -- renewal in 156736 seconds.
xl0: Polling interface state
xl0: client state of 5
xl0: link = 1
xl0: Lost Link on interface
DHCPREQUEST on xl0 to 255.255.255.255 port 67
DHCPACK from 10.208.128.1
bound to 66.31.45.197 -- renewal in 149325 seconds.
xl0: Polling interface state
xl0: client state of 5
xl0: link = 1
xl0: Lost Link on interface
DHCPREQUEST on xl0 to 255.255.255.255 port 67
DHCPACK from 10.208.128.1
bound to 66.31.45.197 -- renewal in 158190 seconds.
xl0: Polling interface state
xl0: client state of 5
xl0: link = 1
xl0: Lost Link on interface
DHCPREQUEST on xl0 to 255.255.255.255 port 67
DHCPACK from 10.208.128.1
bound to 66.31.45.197 -- renewal in 144066 seconds.
xl0: Polling interface state
xl0: client state of 5
xl0: link = 1
xl0: Lost Link on interface
DHCPREQUEST on xl0 to 255.255.255.255 port 67
DHCPACK from 10.208.128.1
bound to 66.31.45.197 -- renewal in 156702 seconds.
===


Note, now that I am online, if I do ifconfig xl0, I get the following:

xl0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST mtu 1500
options=8VLAN_MTU
inet6 fe80::260:97ff:fe72:adf0%xl0 prefixlen 64 scopeid 0x2 
inet 66.31.45.197 netmask 0xf800 broadcast 255.255.255.255
ether 00:60:97:72:ad:f0
media: Ethernet 10baseT/UTP (10baseT/UTP half-duplex)
status: no carrier


So it looks like maybe there is a problem with the xl driver?
(Note I am running with Matthew Dodd's patch).

It would be nice to get this to work so that I don't have to
edit /etc/dhclient.conf, since I never had to do it before.

-- 
Craig Rodrigues
http://crodrigues.org
[EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: dhclient problem with xl0

2003-08-14 Thread Martin Blapp

Have you done a ifconfig xl0 0.0.0.0 up before ?

 xl0: No Link on interface

I think I'll have to support this, if the interface is
not initialized.

Martin
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: dhclient problem with xl0

2003-08-10 Thread Matthew N. Dodd
On Sat, 9 Aug 2003, Martin Blapp wrote:
 You don't have a working link. Maybe it helps if you add a interface
 define in /etc/dhclient.conf wit the possible media.

dhclient is still relying on behavior from the kernel that isn't
guaranteed.

I posted a patch to if_xl.c that should correct the link status for cards
with builtin non-MII PHYs.

-- 
| Matthew N. Dodd  | '78 Datsun 280Z | '75 Volvo 164E | FreeBSD/NetBSD  |
| [EMAIL PROTECTED] |   2 x '84 Volvo 245DL| ix86,sparc,pmax |
| http://www.jurai.net/~winter |  For Great Justice!  | ISO8802.5 4ever |
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: dhclient problem with xl0

2003-08-10 Thread Martin Blapp

Hi,

 Except that you've added code to dhclient that makes poor assumptions
 about the ifmedia status word.  Its optional; for hardware that you can
 detect media status it can be used to display the status.  For other
 hardware, we shouldn't have to lie about media status; if the hardware
 doesn't support reporting media status then we shouldn't do anything with
 the status word.

Isn't there a way to see that the card doesn't support reporting
media status ? If the card does report this, I could add code
to dhclient and all would be fine.

Martin
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: dhclient problem with xl0

2003-08-10 Thread Martin Blapp

Hi,

 dhclient is still relying on behavior from the kernel that isn't
 guaranteed.

I know. But I'd consider that as a kernel bug, not dhclient fault.
Would it help the set the card into promisc. mode anyway, even
if we don't have link ?

 I posted a patch to if_xl.c that should correct the link status for cards
 with builtin non-MII PHYs.

Ok. Thank you very much !

Martin
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: dhclient problem with xl0

2003-08-09 Thread Matthew N. Dodd
On Sat, 9 Aug 2003, Matthew N. Dodd wrote:
 Try this (cut  paste):

The patch I posted was incorrect as I forgot to do a register window
select before reading media status.

ftp://ftp.jurai.net/users/winter/patches/xl_media.patch

-- 
| Matthew N. Dodd  | '78 Datsun 280Z | '75 Volvo 164E | FreeBSD/NetBSD  |
| [EMAIL PROTECTED] |   2 x '84 Volvo 245DL| ix86,sparc,pmax |
| http://www.jurai.net/~winter |  For Great Justice!  | ISO8802.5 4ever |
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: dhclient problem with xl0

2003-08-09 Thread Craig Rodrigues
On Sat, Aug 09, 2003 at 12:28:45PM +0200, Martin Blapp wrote:
 
 Hi,
 
  Here is the output of dhclient -v -d xl0
 
 I I checked. Dhclient still initializes the
 interface and brings it up itself. So there
 is only one possibility:
 
 You don't have a working link. Maybe it helps
 if you add a interface define in /etc/dhclient.conf
 wit the possible media.

Hmmm, I am not sure about this, since if I use the old dhclient
binary, it works fine without problems.  Here is the output
if 'ifconfig xl0':


xl0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST mtu 1500
options=8VLAN_MTU
inet6 fe80::260:97ff:fe72:adf0%xl0 prefixlen 64 scopeid 0x2 
inet 0.0.0.0 netmask 0xff00 broadcast 255.255.255.255
ether 00:60:97:72:ad:f0
media: Ethernet 10baseT/UTP (10baseT/UTP half-duplex)

-- 
Craig Rodrigues
http://crodrigues.org
[EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


dhclient problem with xl0

2003-08-09 Thread Craig Rodrigues
Hi,

I just did a cvsup of -CURRENT and rebuilt the world.
dhclient doesn't seem to work for me any more.
It looks like a problem with dhclient, and not the 
kernel, because an older version of dhclient works fine.

Here is the output of dhclient -v -d xl0

==
Script started on Sat Aug  9 03:11:38 2003
Internet Software Consortium DHCP Client V3.0.1rc11
Copyright 1995-2002 Internet Software Consortium.
All rights reserved.
For info, please visit http://www.isc.org/products/DHCP

Listening on BPF/xl0/00:60:97:72:ad:f0
Sending on   BPF/xl0/00:60:97:72:ad:f0
Sending on   Socket/fallback
xl0: Polling interface state
xl0: client state of 2
xl0: link = 0
xl0: No Link on interface
xl0: Polling interface state
xl0: client state of 2
xl0: link = 0
xl0: No Link on interface
xl0: Polling interface state
xl0: client state of 2
xl0: link = 0
xl0: No Link on interface
xl0: Polling interface state
xl0: client state of 2
xl0: link = 0
xl0: No Link on interface
xl0: Polling interface state
xl0: client state of 2
xl0: link = 0
xl0: No Link on interface

Script done on Sat Aug  9 03:12:04 2003
==


-- 
Craig Rodrigues
http://crodrigues.org
[EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]