Re: Can't resolve hosts via dns on the command line with latest -current

2002-11-05 Thread Giorgos Keramidas
On 2002-11-04 20:25, Kelly Yancey [EMAIL PROTECTED] wrote:
   Let me know if this fixes things for you.  Thanks,

Yes, the patch fixed things for me.

Thanks :)))

%%%
Index: kern/uipc_socket.c
===
RCS file: /home/ncvs/src/sys/kern/uipc_socket.c,v
retrieving revision 1.135
diff -u -p -r1.135 uipc_socket.c
--- kern/uipc_socket.c  2 Nov 2002 05:14:30 -   1.135
+++ kern/uipc_socket.c  5 Nov 2002 04:14:20 -
@@ -1794,7 +1794,7 @@ filt_soread(struct knote *kn, long hint)
return (1);
if (kn-kn_sfflags  NOTE_LOWAT)
return (kn-kn_data = kn-kn_sdata);
-   return (kn-kn_data = so-so_rcv.sb_lowat);
+   return (so-so_rcv.sb_cc = so-so_rcv.sb_lowat);
 }
 
 static void
Index: kern/uipc_socket2.c
===
RCS file: /home/ncvs/src/sys/kern/uipc_socket2.c,v
retrieving revision 1.105
diff -u -p -r1.105 uipc_socket2.c
--- kern/uipc_socket2.c 2 Nov 2002 05:14:30 -   1.105
+++ kern/uipc_socket2.c 5 Nov 2002 04:19:05 -
@@ -705,6 +705,8 @@ sbcompress(sb, m, n)
(unsigned)m-m_len);
n-m_len += m-m_len;
sb-sb_cc += m-m_len;
+   if (m-m_type != MT_DATA)
+   sb-sb_ctl += m-m_len;
m = m_free(m);
continue;
}
@@ -774,6 +776,8 @@ sbdrop(sb, len)
m-m_len -= len;
m-m_data += len;
sb-sb_cc -= len;
+   if (m-m_type != MT_DATA)
+   sb-sb_ctl -= len;
break;
}
len -= m-m_len;
%%%

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Can't resolve hosts via dns on the command line with latest-current

2002-11-04 Thread Kelly Yancey
On Mon, 4 Nov 2002, Giorgos Keramidas wrote:

 On 2002-11-04 01:16, Hidetoshi Shimokawa [EMAIL PROTECTED] wrote:
  I have the same problem and reverting rev. 1.134 of
  /sys/kern/uipc_socket.c fixes the problem.
  The change might have something wrong with a loopback interface.

 True.  I had been seeing problems with network connections the last
 days, and was already in the process of backing out changes one by one
 when I saw this.  Reverting 1.134 fixes things here.  If I put it back
 in, strange DNS failures start causing troubles with almost everything
 (including Sendmail, fetchmail, ssh).

 Giorgos.


  I've had this running on multiple machines for weeks without problems.  What
is your resolve.conf and nsswitch.conf?  Curious,

  Kelly

--
Kelly Yancey -- kbyanc@{posi.net,FreeBSD.org}
Join distributed.net Team FreeBSD: http://www.posi.net/freebsd/Team-FreeBSD/


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Can't resolve hosts via dns on the command line with latest-current

2002-11-04 Thread Kelly Yancey
On Mon, 4 Nov 2002, Hidetoshi Shimokawa wrote:

 I have the same problem and reverting rev. 1.134 of
 /sys/kern/uipc_socket.c fixes the problem.
 The change might have something wrong with a loopback interface.

 /\ Hidetoshi Shimokawa
 \/  [EMAIL PROTECTED]
 PGP public key: http://www.sat.t.u-tokyo.ac.jp/~simokawa/pgp.html

 Index: uipc_socket.c
 ===
 RCS file: /home/ncvs/src/sys/kern/uipc_socket.c,v
 retrieving revision 1.135
 diff -u -r1.135 uipc_socket.c
 --- uipc_socket.c 2 Nov 2002 05:14:30 -   1.135
 +++ uipc_socket.c 3 Nov 2002 14:45:16 -
 @@ -1784,7 +1784,11 @@
  {
   struct socket *so = (struct socket *)kn-kn_fp-f_data;

 +#if 0
   kn-kn_data = so-so_rcv.sb_cc - so-so_rcv.sb_ctl;
 +#else
 + kn-kn_data = so-so_rcv.sb_cc;
 +#endif
   if (so-so_state  SS_CANTRCVMORE) {
   kn-kn_flags |= EV_EOF;
   kn-kn_fflags = so-so_error;


  I suspect something in lib/libc/net/res_send.c is using special knowledge of
the contents of the socket buffer so calculate the real amount of data that
can be read (which this patch does automatically).  I'm looking into it.


 At Sun, 03 Nov 2002 05:39:48 -0800,
 Doug Barton wrote:
 
  Howdy,
 
  With -current built from sources updated at around 8pm PST, I can't
  resolve hosts on the command line if /etc/resolv.conf points to a name
  server running on the local host. The local name server itself is
  working fine, and I can reach any host in /etc/hosts as well.
 
  ktrace /sbin/ping hub.freebsd.org
  ^C
 
  kdump
 651 ktrace   RET   ktrace 0
 651 ktrace   CALL  execve(0xbfbffb03,0xbfbff9e4,0xbfbff9f0)
 651 ktrace   NAMI  /sbin/ping
 

  What is this supposed to demonstrate?

  /etc/nsswitch.conf is unchanged, and contains only:
  hosts: files dns
 
  It doesn't matter if /etc/resolv.conf points to 127.0.0.1, or the IP of
  the box. As soon as I point /etc/resolv.conf at a name server on another
  host, it works.
 
  My -current system from last weekend worked just fine.
 
  Doug
 

  Thanks.  I'll let you know what I find,

  Kelly

--
Kelly Yancey -- kbyanc@{posi.net,FreeBSD.org}
FreeBSD, The Power To Serve: http://www.freebsd.org/


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Can't resolve hosts via dns on the command line with latest-current

2002-11-04 Thread Kelly Yancey
On Sun, 3 Nov 2002, Doug Barton wrote:

 On Mon, 4 Nov 2002, Hidetoshi Shimokawa wrote:

  I have the same problem and reverting rev. 1.134 of
  /sys/kern/uipc_socket.c fixes the problem.

 Confirmed here too, thanks for the tip. I had looked over the recent
 commits to /etc/lib/*, but none of them looked guilty.

 Doug



  Ah, I'm able to recreate the problem now.  It is odd that it only occurs on
loopback, but it doesn't appear specific to DNS. :|  I'm on it.  Thanks,

  Kelly

--
Kelly Yancey -- kbyanc@{posi.net,FreeBSD.org}
FreeBSD, The Power To Serve: http://www.freebsd.org/


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Can't resolve hosts via dns on the command line with latest-current

2002-11-04 Thread Terry Lambert
Kelly Yancey wrote:
   I suspect something in lib/libc/net/res_send.c is using special knowledge of
 the contents of the socket buffer so calculate the real amount of data that
 can be read (which this patch does automatically).  I'm looking into it.

...To ensure that the read does not block, and is not issued
until sufficient data exists.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Can't resolve hosts via dns on the command line with latest-current

2002-11-04 Thread Kelly Yancey
On Mon, 4 Nov 2002, Terry Lambert wrote:

 Kelly Yancey wrote:
I suspect something in lib/libc/net/res_send.c is using special knowledge of
  the contents of the socket buffer so calculate the real amount of data that
  can be read (which this patch does automatically).  I'm looking into it.

 ...To ensure that the read does not block, and is not issued
 until sufficient data exists.

 -- Terry


  It doesn't matter.  It isn't just DNS lookups, mountd fails to run too
because it cannot connect to portmap via localhost.  Oddly, in both cases
sendto() is returning with errno = 49 (EADDRNOTAVAIL).  I've tracked it down
to this code in sys/netinet/ip_output.c:

  /* 127/8 must not appear on wire - RFC1122. */
  if ((ntohl(ip-ip_dst.s_addr)  IN_CLASSA_NSHIFT) == IN_LOOPBACKNET ||
  (ntohl(ip-ip_src.s_addr)  IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) {
  if ((ifp-if_flags  IFF_LOOPBACK) == 0) {
  ipstat.ips_badaddr++;
  error = EADDRNOTAVAIL;
  goto bad;
  }
  }

  Which was last modified in revision 1.150 back in February.  However, I
still don't see how adding an extra counter to the sockbuf could possibly
change the set of events required to get to this code, but it is certainly
what is causing EADDRNOTAVAIL to be returned.  Needless to say, I'm still
researching it.

  Kelly

--
Kelly Yancey -- kbyanc@{posi.net,FreeBSD.org}
FreeBSD, The Power To Serve: http://www.freebsd.org/


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Can't resolve hosts via dns on the command line with latest-current

2002-11-04 Thread Terry Lambert
Kelly Yancey wrote:
   It doesn't matter.  It isn't just DNS lookups, mountd fails to run too
 because it cannot connect to portmap via localhost.  Oddly, in both cases
 sendto() is returning with errno = 49 (EADDRNOTAVAIL).  I've tracked it down
 to this code in sys/netinet/ip_output.c:
 
   /* 127/8 must not appear on wire - RFC1122. */
   if ((ntohl(ip-ip_dst.s_addr)  IN_CLASSA_NSHIFT) == IN_LOOPBACKNET ||
   (ntohl(ip-ip_src.s_addr)  IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) {
   if ((ifp-if_flags  IFF_LOOPBACK) == 0) {
   ipstat.ips_badaddr++;
   error = EADDRNOTAVAIL;
   goto bad;
   }
   }
 
   Which was last modified in revision 1.150 back in February.  However, I
 still don't see how adding an extra counter to the sockbuf could possibly
 change the set of events required to get to this code, but it is certainly
 what is causing EADDRNOTAVAIL to be returned.  Needless to say, I'm still
 researching it.

Pretty clear, I should think:

IF the source address is a loopback address
OR the destination address is a loopback address
THEN
IF the interface does not have the IFF_LOOBACK flag
return EADDRNOTAVAIL

...pretty clearly, the new loopback interface doe not set the flag
IFF_LOOPBACK on the interface, as it is supposed to do.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Can't resolve hosts via dns on the command line with latest -current

2002-11-04 Thread David O'Brien
On Mon, Nov 04, 2002 at 10:45:42AM -0800, Kelly Yancey wrote:
 On Mon, 4 Nov 2002, Giorgos Keramidas wrote:
 
  On 2002-11-04 01:16, Hidetoshi Shimokawa [EMAIL PROTECTED] wrote:
   I have the same problem and reverting rev. 1.134 of
   /sys/kern/uipc_socket.c fixes the problem.
   The change might have something wrong with a loopback interface.
...
   I've had this running on multiple machines for weeks without problems.  What
 is your resolve.conf and nsswitch.conf?  Curious,

A better question is why you are fixing a non-critical, over-1-year-old
bug in networking code this close to the release???  Networking is our
bread and butter, and changes to it can be tricky.  A known non-critical
bug that has existed at least since FBSD 4.2 is better than an unknown
one.  At this point it time, it is better to just not touch things.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Can't resolve hosts via dns on the command line with latest -current

2002-11-04 Thread Giorgos Keramidas
On 2002-11-04 10:45, Kelly Yancey [EMAIL PROTECTED] wrote:
 On Mon, 4 Nov 2002, Giorgos Keramidas wrote:
  True.  I had been seeing problems with network connections the last
  days, and was already in the process of backing out changes one by one
  when I saw this.  Reverting 1.134 fixes things here.  If I put it back
  in, strange DNS failures start causing troubles with almost everything
  (including Sendmail, fetchmail, ssh).

 I've had this running on multiple machines for weeks without
 problems.  What is your resolve.conf and nsswitch.conf?  Curious,

I am running a local named that listens on { 127.0.0.1; }.

My nsswitch.conf contains:

hosts: files dns

and resolv.conf is:

search sea.gr freebsd.org irc.gr ceid.upatras.gr
nameserver 127.0.0.1

The curious thing is that Sendmail or ssh fail to look up hostnames,
while running host(1) works.  I don't know if this is of any help, but
if you need more data about the local setup let me know.

Thanks for looking into this,
Giorgos.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Can't resolve hosts via dns on the command line with latest-current

2002-11-04 Thread Kelly Yancey
On Mon, 4 Nov 2002, Terry Lambert wrote:

 Kelly Yancey wrote:
It doesn't matter.  It isn't just DNS lookups, mountd fails to run too
  because it cannot connect to portmap via localhost.  Oddly, in both cases
  sendto() is returning with errno = 49 (EADDRNOTAVAIL).  I've tracked it down
  to this code in sys/netinet/ip_output.c:
 
/* 127/8 must not appear on wire - RFC1122. */
if ((ntohl(ip-ip_dst.s_addr)  IN_CLASSA_NSHIFT) == IN_LOOPBACKNET ||
(ntohl(ip-ip_src.s_addr)  IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) {
if ((ifp-if_flags  IFF_LOOPBACK) == 0) {
ipstat.ips_badaddr++;
error = EADDRNOTAVAIL;
goto bad;
}
}
 
Which was last modified in revision 1.150 back in February.  However, I
  still don't see how adding an extra counter to the sockbuf could possibly
  change the set of events required to get to this code, but it is certainly
  what is causing EADDRNOTAVAIL to be returned.  Needless to say, I'm still
  researching it.

 Pretty clear, I should think:

   IF the source address is a loopback address
   OR the destination address is a loopback address
   THEN
   IF the interface does not have the IFF_LOOBACK flag
   return EADDRNOTAVAIL

 ...pretty clearly, the new loopback interface doe not set the flag
 IFF_LOOPBACK on the interface, as it is supposed to do.

 -- Terry


  No, it turns out I'm an idiot: somehow the address on loopback got deleted
so it was trying to use my default route.  So I was on a wild goose chase. :|
Oddly enough, though, once I re-added 127.0.0.1/8 to my localhost:

# cat resolv.conf
search nttmcl.com
nameserver 127.0.0.1

# ps auwwwx | grep named
root 320  0.0  0.8  2600 2160  ??  Is5:11PM   0:00.03 named

# ping www.freebsd.org
PING www.freebsd.org (216.136.204.117): 56 data bytes
64 bytes from 216.136.204.117: icmp_seq=0 ttl=50 time=16.343 ms
64 bytes from 216.136.204.117: icmp_seq=1 ttl=50 time=8.764 ms
^C
--- www.freebsd.org ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 8.764/12.553/16.343/3.789 ms

# ping www.yahoo.com
blocks forever

  Go figure.  I've said it before and I'll say it again...I'm working on it.
:|

  Kelly

--
Kelly Yancey -- kbyanc@{posi.net,FreeBSD.org}
Though [the people] may acquiesce, they cannot approve what they do not
 understand. --Thomas Jefferson, 1792.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Can't resolve hosts via dns on the command line with latest-current

2002-11-04 Thread Kelly Yancey
On Mon, 4 Nov 2002, David O'Brien wrote:

 On Mon, Nov 04, 2002 at 10:45:42AM -0800, Kelly Yancey wrote:
  On Mon, 4 Nov 2002, Giorgos Keramidas wrote:
 
   On 2002-11-04 01:16, Hidetoshi Shimokawa [EMAIL PROTECTED] wrote:
I have the same problem and reverting rev. 1.134 of
/sys/kern/uipc_socket.c fixes the problem.
The change might have something wrong with a loopback interface.
 ...
I've had this running on multiple machines for weeks without problems.  What
  is your resolve.conf and nsswitch.conf?  Curious,

 A better question is why you are fixing a non-critical, over-1-year-old
 bug in networking code this close to the release???  Networking is our
 bread and butter, and changes to it can be tricky.  A known non-critical
 bug that has existed at least since FBSD 4.2 is better than an unknown
 one.  At this point it time, it is better to just not touch things.


  I'm not trying to fix a bug in ancient code.  I'm trying to track down a
very specific bug that is reported to be related to a commit I made last
week.  However, so far, I have not found how the two are related.  I've just
been trying to keep the people who are affected by the bug in the loop while
I'm tracking it down.

  Kelly

--
Kelly Yancey -- kbyanc@{posi.net,FreeBSD.org}
Join distributed.net Team FreeBSD: http://www.posi.net/freebsd/Team-FreeBSD/


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Can't resolve hosts via dns on the command line with latest-current

2002-11-04 Thread Kelly Yancey
On Tue, 5 Nov 2002, Giorgos Keramidas wrote:

 On 2002-11-04 10:45, Kelly Yancey [EMAIL PROTECTED] wrote:
  On Mon, 4 Nov 2002, Giorgos Keramidas wrote:
   True.  I had been seeing problems with network connections the last
   days, and was already in the process of backing out changes one by one
   when I saw this.  Reverting 1.134 fixes things here.  If I put it back
   in, strange DNS failures start causing troubles with almost everything
   (including Sendmail, fetchmail, ssh).
 
  I've had this running on multiple machines for weeks without
  problems.  What is your resolve.conf and nsswitch.conf?  Curious,

 I am running a local named that listens on { 127.0.0.1; }.

 My nsswitch.conf contains:

   hosts: files dns

 and resolv.conf is:

   search sea.gr freebsd.org irc.gr ceid.upatras.gr
   nameserver 127.0.0.1

 The curious thing is that Sendmail or ssh fail to look up hostnames,
 while running host(1) works.  I don't know if this is of any help, but
 if you need more data about the local setup let me know.

 Thanks for looking into this,
 Giorgos.


  Thanks for the info.  Are you sure that you only reverted the one delta?
Oddly, when I do the same I still have trouble resolving via localhost (i.e.
with or without revision 1.134).  I can only get DNS via localhost working
again by explicitely adding 127.0.0.1 to lo0.
  If anything I suspect that something is preventing 127.0.0.1 from being
assigned to lo0 at boot (maybe my commit, but I don't see how).  But again,
I'm still looking into it. :|

  Kelly

--
Kelly Yancey -- kbyanc@{posi.net,FreeBSD.org}
Visit the BSD driver database: http://www.posi.net/freebsd/drivers/


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Can't resolve hosts via dns on the command line with latest -current

2002-11-04 Thread David O'Brien
On Mon, Nov 04, 2002 at 05:47:39PM -0800, Kelly Yancey wrote:
  A better question is why you are fixing a non-critical, over-1-year-old
  bug in networking code this close to the release???  Networking is our
  bread and butter, and changes to it can be tricky.  A known non-critical
  bug that has existed at least since FBSD 4.2 is better than an unknown
  one.  At this point it time, it is better to just not touch things.
 
   I'm not trying to fix a bug in ancient code.  I'm trying to track down a
 very specific bug that is reported to be related to a commit I made last
 week.  However, so far, I have not found how the two are related.  I've just
 been trying to keep the people who are affected by the bug in the loop while

I was speaking of your commit last week to uipc_socket.c:

revision 1.134
date: 2002-11-01 21:27:59;  author: kbyanc;  state: Exp;  lines: +1 -1
...
PR: 30634


PR 30634 is over a year old and is classified as non-critical.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Can't resolve hosts via dns on the command line with latest -current

2002-11-04 Thread Giorgos Keramidas
On 2002-11-04 18:38, Kelly Yancey [EMAIL PROTECTED] wrote:
 Thanks for the info.  Are you sure that you only reverted the one delta?

Yes.  I just recompiled the kernel from -rHEAD and started logging
things while I connected to my dialup provider.  Apparently lo0 does
have the 127.0.0.1 address *and* the LOOPBACK flag but somehow fails.

When (near the end of the following log) I back only this change out,
the problems go away :/

The strange thing is that my named listening on lo0 DOES reply, as
you can see from the tcpdump output, but the reply never reaches the
ssh process that initiated the query.

=
keramida@gray[05:05]/home/keramida$ ssh -l charon -p 666 -v labs.gr
OpenSSH_3.5p1 FreeBSD-20021029, SSH protocols 1.5/2.0, OpenSSL 0x0090607f
debug1: Reading configuration data /home/keramida/.ssh/config
debug1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Rhosts Authentication disabled, originating port will not be trusted.
debug1: ssh_connect: needpriv 0
^C

root@gray[05:04]/root# tcpdump -i lo0 -s 128 -v -n
tcpdump: listening on lo0
05:05:34.616515 127.0.0.1.49181  127.0.0.1.53: [udp sum ok]  24818+ ? labs.gr. 
(25) (ttl 64, id 20931, len 53)
05:05:34.618115 127.0.0.1.53  127.0.0.1.49181: [udp sum ok]  24818 0/1/0 (66) (ttl 
64, id 2744, len 94)
05:05:34.619452 127.0.0.1.49182  127.0.0.1.53: [udp sum ok]  24819+ A? labs.gr. (25) 
(ttl 64, id 63225, len 53)
05:05:34.621080 127.0.0.1.53  127.0.0.1.49182:  24819 1/6/6 labs.gr. A 62.103.160.6 
(279) (ttl 64, id 1753, len 307)
05:05:39.621503 127.0.0.1.49183  127.0.0.1.53: [udp sum ok]  24819+ A? labs.gr. (25) 
(ttl 64, id 31195, len 53)
05:05:39.623584 127.0.0.1.53  127.0.0.1.49183:  24819 1/6/6 labs.gr. A 62.103.160.6 
(279) (ttl 64, id 5785, len 307)
05:05:49.621965 127.0.0.1.49184  127.0.0.1.53: [udp sum ok]  24819+ A? labs.gr. (25) 
(ttl 64, id 34796, len 53)
05:05:49.624029 127.0.0.1.53  127.0.0.1.49184:  24819 1/6/6 labs.gr. A 62.103.160.6 
(279) (ttl 64, id 60299, len 307)
^C
8 packets received by filter
0 packets dropped by kernel

root@gray[05:07]/usr/src/sys/kern# cvs -qR diff -kk -u -r1.133 -r1.134 uipc_socket.c | 
patch -p0 -R
...
root@gray[05:07]/usr/src/sys/kern# cd ../i386/conf
root@gray[05:08]/usr/src/sys/i386/conf# config -g -d /usr/obj/usr/src/sys/GRAY GRAY
Kernel build directory is /usr/obj/usr/src/sys/GRAY
Don't forget to do a ``make depend''
root@gray[05:08]/usr/src/sys/i386/conf# cd /usr/obj/usr/src/sys/GRAY
root@gray[05:08]/usr/obj/usr/src/sys/GRAY# rm uipc_socket.o
root@gray[05:08]/usr/obj/usr/src/sys/GRAY# make -DNO_MODULES all  make -DNO_MODULES 
install

[ reboot after backout ]

keramida@gray[05:12]/home/keramida$ ssh -l charon -p 666 -v labs.gr
OpenSSH_3.5p1 FreeBSD-20021029, SSH protocols 1.5/2.0, OpenSSL
0x0090607f
debug1: Reading configuration data /home/keramida/.ssh/config
debug1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Rhosts Authentication disabled, originating port will not be
trusted.
debug1: ssh_connect: needpriv 0
debug1: Connecting to labs.gr [62.103.160.6] port 666.
debug1: Connection established.
...

[ and it works ]
=

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Can't resolve hosts via dns on the command line with latest-current

2002-11-04 Thread Kelly Yancey
On Mon, 4 Nov 2002, David O'Brien wrote:

 On Mon, Nov 04, 2002 at 05:47:39PM -0800, Kelly Yancey wrote:
   A better question is why you are fixing a non-critical, over-1-year-old
   bug in networking code this close to the release???  Networking is our
   bread and butter, and changes to it can be tricky.  A known non-critical
   bug that has existed at least since FBSD 4.2 is better than an unknown
   one.  At this point it time, it is better to just not touch things.
 
I'm not trying to fix a bug in ancient code.  I'm trying to track down a
  very specific bug that is reported to be related to a commit I made last
  week.  However, so far, I have not found how the two are related.  I've just
  been trying to keep the people who are affected by the bug in the loop while

 I was speaking of your commit last week to uipc_socket.c:
 
 revision 1.134
 date: 2002-11-01 21:27:59;  author: kbyanc;  state: Exp;  lines: +1 -1
 ...
 PR: 30634
 

 PR 30634 is over a year old and is classified as non-critical.


  It was important to me.  I ran into the problem independently and have been
running the committed patches for 2 weeks on multiple machines.  However, none
of the machines made UDP connections via lo0 so I didn't spot the bug before
commit.  However, since commit I have seen 4 reports of people having trouble
resolving via localhost, 2 of which claim the backing out the commit solves
their problems.  I'm actively tracking it down (as my numerous updates
throughout the day should indicate) and if I don't find the problem soon I
will revert the delta in question.  This is code we use at work and I
certainly want to fix the bug if it turns out to be related to my commit.

  Kelly

--
Kelly Yancey -- kbyanc@{posi.net,FreeBSD.org}


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Can't resolve hosts via dns on the command line with latest-current

2002-11-04 Thread Kelly Yancey
On Tue, 5 Nov 2002, Giorgos Keramidas wrote:

 On 2002-11-04 18:38, Kelly Yancey [EMAIL PROTECTED] wrote:
  Thanks for the info.  Are you sure that you only reverted the one delta?

 Yes.  I just recompiled the kernel from -rHEAD and started logging
 things while I connected to my dialup provider.  Apparently lo0 does
 have the 127.0.0.1 address *and* the LOOPBACK flag but somehow fails.

 When (near the end of the following log) I back only this change out,
 the problems go away :/


  Thanks for the great trace and your patience.  I believe I found the root of
the problem.  Could you please try the attached patch?  I'm afraid that
if I hadn't gotten thown off this morning be my lo0 lacking a
127.0.0.1 address I probably would have found it much, much sooner
(it's pretty obvious in hindsight).  At the very least, I also caught a
couple of pieces of code that are manipulating the socket buffer behind
sballoc() and sbfree()'s back so I've modified them to update the sb_cc
counter directly also.
  Let me know if this fixes things for you.  Thanks,

  Kelly

--
Kelly Yancey -- kbyanc@{posi.net,FreeBSD.org}
Democracy is a device that insures we shall be governed no better than we
 deserve. -- George Bernard Shaw

Index: kern/uipc_socket.c
===
RCS file: /home/ncvs/src/sys/kern/uipc_socket.c,v
retrieving revision 1.135
diff -u -p -r1.135 uipc_socket.c
--- kern/uipc_socket.c  2 Nov 2002 05:14:30 -   1.135
+++ kern/uipc_socket.c  5 Nov 2002 04:14:20 -
@@ -1794,7 +1794,7 @@ filt_soread(struct knote *kn, long hint)
return (1);
if (kn-kn_sfflags  NOTE_LOWAT)
return (kn-kn_data = kn-kn_sdata);
-   return (kn-kn_data = so-so_rcv.sb_lowat);
+   return (so-so_rcv.sb_cc = so-so_rcv.sb_lowat);
 }
 
 static void
Index: kern/uipc_socket2.c
===
RCS file: /home/ncvs/src/sys/kern/uipc_socket2.c,v
retrieving revision 1.105
diff -u -p -r1.105 uipc_socket2.c
--- kern/uipc_socket2.c 2 Nov 2002 05:14:30 -   1.105
+++ kern/uipc_socket2.c 5 Nov 2002 04:19:05 -
@@ -705,6 +705,8 @@ sbcompress(sb, m, n)
(unsigned)m-m_len);
n-m_len += m-m_len;
sb-sb_cc += m-m_len;
+   if (m-m_type != MT_DATA)
+   sb-sb_ctl += m-m_len;
m = m_free(m);
continue;
}
@@ -774,6 +776,8 @@ sbdrop(sb, len)
m-m_len -= len;
m-m_data += len;
sb-sb_cc -= len;
+   if (m-m_type != MT_DATA)
+   sb-sb_ctl -= len;
break;
}
len -= m-m_len;



Re: Can't resolve hosts via dns on the command line with latest -current

2002-11-04 Thread Hidetoshi Shimokawa
At Tue, 5 Nov 2002 03:12:05 +0200,
Giorgos Keramidas wrote:
 The curious thing is that Sendmail or ssh fail to look up hostnames,
 while running host(1) works.  I don't know if this is of any help, but
 if you need more data about the local setup let me know.

host(or dig, nslookup) doesn't use resolver in libc.
The change affects processes which uses kevent().

/\ Hidetoshi Shimokawa
\/  [EMAIL PROTECTED]
PGP public key: http://www.sat.t.u-tokyo.ac.jp/~simokawa/pgp.html



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Can't resolve hosts via dns on the command line with latest -current

2002-11-04 Thread Manfred Antar
At 08:25 PM 11/4/2002 -0800, Kelly Yancey wrote:
On Tue, 5 Nov 2002, Giorgos Keramidas wrote:

 On 2002-11-04 18:38, Kelly Yancey [EMAIL PROTECTED] wrote:
  Thanks for the info.  Are you sure that you only reverted the one delta?

 Yes.  I just recompiled the kernel from -rHEAD and started logging
 things while I connected to my dialup provider.  Apparently lo0 does
 have the 127.0.0.1 address *and* the LOOPBACK flag but somehow fails.

 When (near the end of the following log) I back only this change out,
 the problems go away :/


  Thanks for the great trace and your patience.  I believe I found the root of
the problem.  Could you please try the attached patch?  I'm afraid that
if I hadn't gotten thown off this morning be my lo0 lacking a
127.0.0.1 address I probably would have found it much, much sooner
(it's pretty obvious in hindsight).  At the very least, I also caught a
couple of pieces of code that are manipulating the socket buffer behind
sballoc() and sbfree()'s back so I've modified them to update the sb_cc
counter directly also.
  Let me know if this fixes things for you.  Thanks,

  Kelly

--
Kelly Yancey -- kbyanc@{posi.net,FreeBSD.org}
Democracy is a device that insures we shall be governed no better than we
 deserve. -- George Bernard Shaw

This patch fixes a bug I've noticed for the past few days.
Connecting to a FreeBSD current box via ssh2 from Win-2000 (local network)
It just started happening in the past few days.
I could connect but it would take about a minute to connect.
Now it's back instant connect with patch

Manfred
==
||  [EMAIL PROTECTED]   ||
||  Ph. (415) 681-6235  ||
==


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Can't resolve hosts via dns on the command line with latest-current

2002-11-04 Thread Doug Barton
Kelly Yancey wrote:

   Thanks for the great trace and your patience.  I believe I found the root of
 the problem.  Could you please try the attached patch? 

Works for me, thanks.

Doug

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Can't resolve hosts via dns on the command line with latest -current

2002-11-03 Thread Doug Barton
Howdy,

With -current built from sources updated at around 8pm PST, I can't
resolve hosts on the command line if /etc/resolv.conf points to a name
server running on the local host. The local name server itself is
working fine, and I can reach any host in /etc/hosts as well.

ktrace /sbin/ping hub.freebsd.org
^C

kdump
   651 ktrace   RET   ktrace 0
   651 ktrace   CALL  execve(0xbfbffb03,0xbfbff9e4,0xbfbff9f0)
   651 ktrace   NAMI  /sbin/ping

/etc/nsswitch.conf is unchanged, and contains only:
hosts: files dns 

It doesn't matter if /etc/resolv.conf points to 127.0.0.1, or the IP of
the box. As soon as I point /etc/resolv.conf at a name server on another
host, it works.

My -current system from last weekend worked just fine. 

Doug

-- 
   We have known freedom's price. We have shown freedom's power.
  And in this great conflict, ...  we will see freedom's victory.
- George W. Bush, President of the United States
  State of the Union, January 28, 2002

 Do YOU Yahoo!?

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Can't resolve hosts via dns on the command line with latest -current

2002-11-03 Thread Hidetoshi Shimokawa
I have the same problem and reverting rev. 1.134 of
/sys/kern/uipc_socket.c fixes the problem.
The change might have something wrong with a loopback interface.

/\ Hidetoshi Shimokawa
\/  [EMAIL PROTECTED]
PGP public key: http://www.sat.t.u-tokyo.ac.jp/~simokawa/pgp.html

Index: uipc_socket.c
===
RCS file: /home/ncvs/src/sys/kern/uipc_socket.c,v
retrieving revision 1.135
diff -u -r1.135 uipc_socket.c
--- uipc_socket.c   2 Nov 2002 05:14:30 -   1.135
+++ uipc_socket.c   3 Nov 2002 14:45:16 -
@@ -1784,7 +1784,11 @@
 {
struct socket *so = (struct socket *)kn-kn_fp-f_data;
 
+#if 0
kn-kn_data = so-so_rcv.sb_cc - so-so_rcv.sb_ctl;
+#else
+   kn-kn_data = so-so_rcv.sb_cc;
+#endif
if (so-so_state  SS_CANTRCVMORE) {
kn-kn_flags |= EV_EOF;
kn-kn_fflags = so-so_error;


At Sun, 03 Nov 2002 05:39:48 -0800,
Doug Barton wrote:
 
 Howdy,
 
 With -current built from sources updated at around 8pm PST, I can't
 resolve hosts on the command line if /etc/resolv.conf points to a name
 server running on the local host. The local name server itself is
 working fine, and I can reach any host in /etc/hosts as well.
 
 ktrace /sbin/ping hub.freebsd.org
 ^C
 
 kdump
651 ktrace   RET   ktrace 0
651 ktrace   CALL  execve(0xbfbffb03,0xbfbff9e4,0xbfbff9f0)
651 ktrace   NAMI  /sbin/ping
 
 /etc/nsswitch.conf is unchanged, and contains only:
 hosts: files dns 
 
 It doesn't matter if /etc/resolv.conf points to 127.0.0.1, or the IP of
 the box. As soon as I point /etc/resolv.conf at a name server on another
 host, it works.
 
 My -current system from last weekend worked just fine. 
 
 Doug
 
 -- 
We have known freedom's price. We have shown freedom's power.
   And in this great conflict, ...  we will see freedom's victory.
   - George W. Bush, President of the United States
   State of the Union, January 28, 2002
 
  Do YOU Yahoo!?
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with unsubscribe freebsd-current in the body of the message
 

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Can't resolve hosts via dns on the command line with latest -current

2002-11-03 Thread Peter Wemm
Doug Barton wrote:
 Howdy,
 
 With -current built from sources updated at around 8pm PST, I can't
 resolve hosts on the command line if /etc/resolv.conf points to a name
 server running on the local host. The local name server itself is
 working fine, and I can reach any host in /etc/hosts as well.
 
 ktrace /sbin/ping hub.freebsd.org
 ^C
 
 kdump
651 ktrace   RET   ktrace 0
651 ktrace   CALL  execve(0xbfbffb03,0xbfbff9e4,0xbfbff9f0)
651 ktrace   NAMI  /sbin/ping
 
 /etc/nsswitch.conf is unchanged, and contains only:
 hosts: files dns 
 
 It doesn't matter if /etc/resolv.conf points to 127.0.0.1, or the IP of
 the box. As soon as I point /etc/resolv.conf at a name server on another
 host, it works.

I'm having similar problems.  If I have 2 or 3 nameservers listed and
127.0.0.1 first, then I get a 10-20 second timeout before the resolver
library switches to another server.

Cheers,
-Peter
--
Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
All of this is for nothing if we don't go to the stars - JMS/B5


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Can't resolve hosts via dns on the command line with latest -current

2002-11-03 Thread Giorgos Keramidas
On 2002-11-04 01:16, Hidetoshi Shimokawa [EMAIL PROTECTED] wrote:
 I have the same problem and reverting rev. 1.134 of
 /sys/kern/uipc_socket.c fixes the problem.
 The change might have something wrong with a loopback interface.

True.  I had been seeing problems with network connections the last
days, and was already in the process of backing out changes one by one
when I saw this.  Reverting 1.134 fixes things here.  If I put it back
in, strange DNS failures start causing troubles with almost everything
(including Sendmail, fetchmail, ssh).

Giorgos.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Can't resolve hosts via dns on the command line with latest-current

2002-11-03 Thread Doug Barton
On Mon, 4 Nov 2002, Hidetoshi Shimokawa wrote:

 I have the same problem and reverting rev. 1.134 of
 /sys/kern/uipc_socket.c fixes the problem.

Confirmed here too, thanks for the tip. I had looked over the recent
commits to /etc/lib/*, but none of them looked guilty.

Doug


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message