Re: ppp command port does not listens on ipv4 unless no INET6 in kernel

2006-09-18 Thread Julian Stacey

 Tested. It Works. Thanks !
 I tested the patch on PPP running under both kernels IPV4+6  V4only
 just to be sure, it works on both,  allows me to type dial  down
 (all I tried or wanted.)

I'd been wondering why I was the first person to notice the problem.
Then I noticed my kernel (unlike GENERIC) did not have 
device  faith 
(which I had removed thinking I didnt need V6).
Not sure if significant, but thought I should mention it.

Julian
-- 
Julian Stacey.  BSD Unix C Net Consultancy, Munich/Muenchen  http://berklix.com
Don't buy it ! Get it free !  http://berklix.org/free-software
Mail Ascii, not HTML.   Ihr Rauch = mein allergischer Kopfschmerz.
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: ppp command port does not listens on ipv4 unless no INET6 in kernel

2006-09-18 Thread Hajimu UMEMOTO
Hi,

 On Mon, 18 Sep 2006 23:46:09 +0200 (CEST)
 Julian Stacey [EMAIL PROTECTED] said:

jhs I'd been wondering why I was the first person to notice the problem.

I'm not sure why there was no report about it, but I had never been
using inet socket.  I don't want to open inet socket for controlling
ppp(8) for security reason, and I used to to use just unix domain
socket to control ppp(8).

jhs Then I noticed my kernel (unlike GENERIC) did not have 
jhsdevice  faith 
jhs (which I had removed thinking I didnt need V6).
jhs Not sure if significant, but thought I should mention it.

It is for an IPv6-to-IPv4 TCP relay.  I think that most of the people
are not using it, actually.  So, it shouldn't be a problem.

Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
[EMAIL PROTECTED]  [EMAIL PROTECTED],jp.}FreeBSD.org
http://www.imasy.org/~ume/
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: ppp command port does not listens on ipv4 unless no INET6 in kernel

2006-09-18 Thread Matthew D. Fuller
On Mon, Sep 18, 2006 at 11:46:09PM +0200 I heard the voice of
Julian Stacey, and lo! it spake thus:
 
 I'd been wondering why I was the first person to notice the problem.

Actually, I noticed it a while back (6 months or so?  Something like
that...) when I tried to run pppctl from my workstation instead of the
router.  I looked at sockstat, said Huh, that's kinda annoying, and
just always used pppctl from the router.


-- 
Matthew Fuller (MF4839)   |  [EMAIL PROTECTED]
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
   On the Internet, nobody can hear you scream.
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: ppp command port does not listens on ipv4 unless no INET6 in kernel

2006-09-17 Thread Hajimu UMEMOTO
Hi,

 On Thu, 14 Sep 2006 15:44:18 +0200 (CEST)
 Julian Stacey [EMAIL PROTECTED] said:

jhs I'm not clear if this is a bug or a config error:
jhs It seems though my /usr/sbin/ppp was moving traffic
jhs to  from internet, it was only listening for commands
jhs (not data) on ipv6, not ipv4, thus I could not type commands
jhs like dial  drop, unless instead of running ppp -auto
jhs instead I invoked ppp manually in foreground on localhost.

As far as I read the source of ppp(8), it only listen on an IPv6, and
expects to listen on an IPv4 through an IPv4-mapped IPv6 address.
However, an IPv4-mapped IPv6 address feature is disabled by default.
ppp(8) should be rewritten to listen on both an IPv4 and an IPv6.
But, it is slightly complex.  So, I made a patch to enable an
IPv4-mapped IPv6 address only for the socket that ppp(8) is listening
on.
I have no environment for testing this.  Could you try this patch?

Index: usr.sbin/ppp/server.c
diff -u -p usr.sbin/ppp/server.c.orig usr.sbin/ppp/server.c
--- usr.sbin/ppp/server.c.orig  Sun Sep  5 10:46:52 2004
+++ usr.sbin/ppp/server.c   Sun Sep 17 19:54:43 2006
@@ -346,6 +346,13 @@ server_TcpOpen(struct bundle *bundle, u_
 goto failed;
   }
 
+#ifndef NOINET6
+  if (probe.ipv6_available) {
+int off = 0;
+setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (char *)off, sizeof(off));
+  }
+#endif
+
   setsockopt(s, SOL_SOCKET, SO_REUSEADDR, s, sizeof s);
   if (bind(s, (struct sockaddr *)ss, sz)  0) {
 log_Printf(LogWARN, Tcp: bind: %s\n, strerror(errno));


Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
[EMAIL PROTECTED]  [EMAIL PROTECTED],jp.}FreeBSD.org
http://www.imasy.org/~ume/
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: ppp command port does not listens on ipv4 unless no INET6 in kernel

2006-09-17 Thread Julian H. Stacey
 I have no environment for testing this.  Could you try this patch?

Yes certainly, thanks a lot, delighted to get a reply  will report back soon.

-- 
Julian Stacey.  BSD Unix C Net Consultancy, Munich/Muenchen  http://berklix.com
Mail Ascii, not HTML.   Ihr Rauch = mein allergischer Kopfschmerz.
Don't buy it ! Get it free !  http://berklix.org/free-software
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: ppp command port does not listens on ipv4 unless no INET6 in kernel

2006-09-17 Thread Brian Somers
On Sun, 17 Sep 2006 20:10:47 +0900 Hajimu UMEMOTO [EMAIL PROTECTED] wrote:
 Hi,
 
  On Thu, 14 Sep 2006 15:44:18 +0200 (CEST)
  Julian Stacey [EMAIL PROTECTED] said:
 
 jhs I'm not clear if this is a bug or a config error:
 jhs It seems though my /usr/sbin/ppp was moving traffic
 jhs to  from internet, it was only listening for commands
 jhs (not data) on ipv6, not ipv4, thus I could not type commands
 jhs like dial  drop, unless instead of running ppp -auto
 jhs instead I invoked ppp manually in foreground on localhost.
 
 As far as I read the source of ppp(8), it only listen on an IPv6, and
 expects to listen on an IPv4 through an IPv4-mapped IPv6 address.
 However, an IPv4-mapped IPv6 address feature is disabled by default.
 ppp(8) should be rewritten to listen on both an IPv4 and an IPv6.
 But, it is slightly complex.  So, I made a patch to enable an
 IPv4-mapped IPv6 address only for the socket that ppp(8) is listening
 on.
 I have no environment for testing this.  Could you try this patch?
 
 Index: usr.sbin/ppp/server.c
 diff -u -p usr.sbin/ppp/server.c.orig usr.sbin/ppp/server.c
 --- usr.sbin/ppp/server.c.origSun Sep  5 10:46:52 2004
 +++ usr.sbin/ppp/server.c Sun Sep 17 19:54:43 2006
 @@ -346,6 +346,13 @@ server_TcpOpen(struct bundle *bundle, u_
  goto failed;
}
  
 +#ifndef NOINET6
 +  if (probe.ipv6_available) {
 +int off = 0;
 +setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (char *)off, sizeof(off));
 +  }
 +#endif
 +
setsockopt(s, SOL_SOCKET, SO_REUSEADDR, s, sizeof s);
if (bind(s, (struct sockaddr *)ss, sz)  0) {
  log_Printf(LogWARN, Tcp: bind: %s\n, strerror(errno));
 
 
 Sincerely,

AFAIR I had trouble getting that code to work and was advised at
the time that I'd just get the mapped port for free.  I haven't
been using IPv6 on production machines for some time, so I haven't
seen the problem :(

It'd be great if you'd commit the patch if Julian says it works
ok for him.

Cheers.

-- 
Brian Somers  [EMAIL PROTECTED]
Don't _EVER_ lose your sense of humour !   [EMAIL PROTECTED]
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: ppp command port does not listens on ipv4 unless no INET6 in kernel

2006-09-17 Thread Julian H. Stacey
Brian Somers wrote:
 On Sun, 17 Sep 2006 20:10:47 +0900 Hajimu UMEMOTO [EMAIL PROTECTED] wrote:
  Hi,
  
   On Thu, 14 Sep 2006 15:44:18 +0200 (CEST)
   Julian Stacey [EMAIL PROTECTED] said:
  
  jhs I'm not clear if this is a bug or a config error:
  jhs It seems though my /usr/sbin/ppp was moving traffic
  jhs to  from internet, it was only listening for commands
  jhs (not data) on ipv6, not ipv4, thus I could not type commands
  jhs like dial  drop, unless instead of running ppp -auto
  jhs instead I invoked ppp manually in foreground on localhost.
  
  As far as I read the source of ppp(8), it only listen on an IPv6, and
  expects to listen on an IPv4 through an IPv4-mapped IPv6 address.
  However, an IPv4-mapped IPv6 address feature is disabled by default.
  ppp(8) should be rewritten to listen on both an IPv4 and an IPv6.
  But, it is slightly complex.  So, I made a patch to enable an
  IPv4-mapped IPv6 address only for the socket that ppp(8) is listening
  on.
  I have no environment for testing this.  Could you try this patch?
  
  Index: usr.sbin/ppp/server.c
  diff -u -p usr.sbin/ppp/server.c.orig usr.sbin/ppp/server.c
  --- usr.sbin/ppp/server.c.orig  Sun Sep  5 10:46:52 2004
  +++ usr.sbin/ppp/server.c   Sun Sep 17 19:54:43 2006
  @@ -346,6 +346,13 @@ server_TcpOpen(struct bundle *bundle, u_
   goto failed;
 }
   
  +#ifndef NOINET6
  +  if (probe.ipv6_available) {
  +int off = 0;
  +setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (char *)off, sizeof(off));
  +  }
  +#endif
  +
 setsockopt(s, SOL_SOCKET, SO_REUSEADDR, s, sizeof s);
 if (bind(s, (struct sockaddr *)ss, sz)  0) {
   log_Printf(LogWARN, Tcp: bind: %s\n, strerror(errno));
  
  
  Sincerely,
 
 AFAIR I had trouble getting that code to work and was advised at
 the time that I'd just get the mapped port for free.  I haven't
 been using IPv6 on production machines for some time, so I haven't
 seen the problem :(
 
 It'd be great if you'd commit the patch if Julian says it works
 ok for him.

Tested. It Works. Thanks !
I tested the patch on PPP running under both kernels IPV4+6  V4only
just to be sure, it works on both,  allows me to type dial  down
(all I tried or wanted.)

Output With patch:

strings /boot/kernel/kernel | grep ___ | grep INET
___options INET
___options INET6
sockstat -l
USER COMMANDPID   FD PROTO  LOCAL ADDRESS FOREIGN ADDRESS  
root ppp939   9  tcp46  *:12345   *:*

strings /boot/kernel/kernel | grep ___ | grep INET
___options INET
___# options INET6
sockstat -l
USER COMMANDPID   FD PROTO  LOCAL ADDRESS FOREIGN ADDRESS  
root ppp931   9  tcp4   *:12345   *:*

Old V4+6 Kernel pre patch:
 USER COMMANDPID   FD PROTO  LOCAL ADDRESS FOREIGN ADDRESS
 root ppp1020  9  tcp6   *:12345   *:*

I hope it's commited.  (Dont't know if a 2nd tester is needed to verify ?)
Thanks Hajimu :-)
Julian
-- 
Julian Stacey.  BSD Unix C Net Consultancy, Munich/Muenchen  http://berklix.com
Mail Ascii, not HTML.   Ihr Rauch = mein allergischer Kopfschmerz.
Don't buy it ! Get it free !  http://berklix.org/free-software
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: ppp command port does not listens on ipv4 unless no INET6 in kernel

2006-09-17 Thread Hajimu UMEMOTO
Hi,

 On Sun, 17 Sep 2006 23:35:57 +0200
 Julian H. Stacey [EMAIL PROTECTED] said:

 AFAIR I had trouble getting that code to work and was advised at
 the time that I'd just get the mapped port for free.  I haven't
 been using IPv6 on production machines for some time, so I haven't
 seen the problem :(
 
 It'd be great if you'd commit the patch if Julian says it works
 ok for him.

jhs Tested. It Works. Thanks !
jhs I tested the patch on PPP running under both kernels IPV4+6  V4only
jhs just to be sure, it works on both,  allows me to type dial  down
jhs (all I tried or wanted.)

jhs Output With patch:

jhs strings /boot/kernel/kernel | grep ___ | grep INET
jhs ___options INET
jhs ___options INET6
jhs sockstat -l
jhs USER COMMANDPID   FD PROTO  LOCAL ADDRESS FOREIGN ADDRESS  

jhs root ppp939   9  tcp46  *:12345   *:*

jhs strings /boot/kernel/kernel | grep ___ | grep INET
jhs ___options INET
jhs ___# options INET6
jhs sockstat -l
jhs USER COMMANDPID   FD PROTO  LOCAL ADDRESS FOREIGN ADDRESS  

jhs root ppp931   9  tcp4   *:12345   *:*

jhs Old V4+6 Kernel pre patch:
jhs  USER COMMANDPID   FD PROTO  LOCAL ADDRESS FOREIGN ADDRESS
jhs  root ppp1020  9  tcp6   *:12345   *:*

jhs I hope it's commited.  (Dont't know if a 2nd tester is needed to verify ?)

Thank you for testing.  I've just committed it.

jhs Thanks Hajimu :-)

You are welcome.

Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
[EMAIL PROTECTED]  [EMAIL PROTECTED],jp.}FreeBSD.org
http://www.imasy.org/~ume/
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to [EMAIL PROTECTED]


ppp command port does not listens on ipv4 unless no INET6 in kernel

2006-09-14 Thread Julian Stacey
Hi Net@ people,
I posted this to hackers@ Mon, 11 Sep 2006 20:30:38 +0200 (CEST)
 got no response. I've fixed typos in subject  body.
Hopefuly net@ is more appropriate  can respond please :-)

---
(cc [EMAIL PROTECTED] who's maybe expert, from examples seen in share :-)
I'm not clear if this is a bug or a config error:
It seems though my /usr/sbin/ppp was moving traffic
to  from internet, it was only listening for commands
(not data) on ipv6, not ipv4, thus I could not type commands
like dial  drop, unless instead of running ppp -auto
instead I invoked ppp manually in foreground on localhost.

Detail:
I have 2 alternate firewall/ gateways connected to world via DSL.
Each ran 4.10-Release OK. I raised one to 6.1-Release.
With a 6.1 Release custom kernel compiled with
options INET6
 /etc/ppp/ppp.conf with
set server +12345 mypasswd
sockstat -l showed only:
 USER COMMANDPID   FD PROTO  LOCAL ADDRESS FOREIGN ADDRESS
 root ppp1020  9  tcp6   *:12345   *:*
( no 2nd line for ipv4),  so from my internal host, this failed:
pppctl -p mypasswd dsl:12345
 in fact even on my host named dsl, this failed
telnet localhost 12345
So I built a new kernel without INET6  then sockstat -l showed
 root ppp972   9  tcp4   *:12345   *:*
 that works OK, I can finally manually control my PPP link up  down via
pppctl -p mypasswd dsl:12345
On my 4.10 host which has a kernel with both
options  INET
options  INET6
(as also has 4.10 GENERIC), that has always worked OK,   sockstat -l   shows
 root ppp5129 tcp46  *:12345   *:*
 pppctl -p mypasswd dsl:12345  works OK.

Questions:
- - Did I misconfigure something ?
- - Does ppp on 6.1 perhaps not now listen on ipv4 if INET6 is in kernel ?
  (Unfortunate if so, as INET6 in in GENERIC kernel)
- - Should ppp have an extra flag added, forcing Do listen on ipv4 ?
- - Is this a bug ? Should I file a send-pr ?  Did I misconfig something ?

Julian
- --
Julian Stacey.  BSD Unix C Net Consultancy, Munich/Muenchen  http://berklix.com
Mail Ascii, not HTML.   Ihr Rauch = mein allergischer Kopfschmerz.
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to [EMAIL PROTECTED]