*BSD News Article 15763


Return to BSD News archive

Xref: sserve comp.os.386bsd.questions:2252 comp.protocols.ppp:1312
Newsgroups: comp.os.386bsd.questions,comp.protocols.ppp
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!howland.reston.ans.net!noc.near.net!uunet!utcsri!newsflash.concordia.ca!sifon!CC.UMontreal.CA!IRO.UMontreal.CA!zap!fortin
From: fortin@zap.uniforum.qc.ca (Denis Fortin)
Subject: Re: PPP is up!  But now I have a problem with ftp, talk, etc...
Organization: zap, Montreal, QC, Canada
Summary: PPP-1.2 has a fairly serious bug
References: <C6Ap35.46C@zap.uniforum.qc.ca> <C6K912.MHJ@claircom.com>
Message-ID: <C6n10y.1Mt@zap.uniforum.qc.ca>
Date: Fri, 7 May 1993 03:43:30 GMT
Lines: 110

In article <C6K912.MHJ@claircom.com> cam@claircom.com (Cam Elliott) writes:
>
>In article <C6Ap35.46C@zap.uniforum.qc.ca>, fortin@zap.uniforum.qc.ca (Denis Fortin) writes:
>|> 	I have solved my PPP problems, and now my 386BSD machine will
>|> talk correctly to my SCO gateway to the Internet (using vjmode old).

What I am using is the free implementation of PPP called PPP-1.2 (the
alpha release, I believe?!?).  It is the package that was advertised
as having been ported to 386BSD a while back on comp.os.386bsd.announce.

>|> [but now,] If I ftp to my neighbour (ftp rcogate), a connection gets
>|> established, I can log on, and I can do "cd pub"...  But whenever
>|> I try to do "ls" or "get file", all I get is:
>|> 
>|> 	ftp: bind: Can't assign requested address
>|> 
>|> I'm a bit confused by this error!?!
>
>I had the exact same problem, and I believe the way I fixed this 
>was to 'ifconfig lo0 myipaddress'
>
>or some such,
>any BSD IP experts care to comment?

Yay, I've solved the problem!!!

The problem is that there is a bug in "pppd"!  The internet addresses
that it associates with both ends of the PPP link are not correct: they
have the "sa_len" field left unset, which causes the "bind()" system
call to never find them and therefore the "Can't assign requested
address" message appears!

I was able to track this down by adding traces to the kernel left
and right until what was happening became clear (having the source 
to your O/S is *GREAT*...  Three hoorays for 386BSD).

So now, I am able to reliably connect to an SCO ODT 2.0 machine with
PPP (the only funny argument that is needed is "vjmode old" on the
call to pppd).

The only annoying part is that the serial driver is still dropping
characters every once in a while (silo overflow and all that :-(
Boy, how do I miss FAS and it's rock solid 38400 bps (with a few
copies of compress running in parallel)!  Hopefully a future patchkit
will incorporate a solid serial driver (bde's?).

I wish to thank everybody who's responded to my PPP questions during
the past few weeks.  I'll try to get back to all of them (I have
kept all your mail).

Now, as to the bug in ppp-1.2, here is the patch that is required 
to fix pppd/pppd.h:
----------------------------snip snip snip----------------------------------
*** pppd.h-orig	Wed May  5 23:17:02 1993
--- pppd.h	Wed May  5 23:21:15 1993
***************
*** 316,321 ****
--- 316,322 ----
      strncpy(ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); \
      bzero((char *) &ifr.ifr_addr, sizeof(ifr.ifr_addr));  \
      ifr.ifr_addr.sa_family = AF_INET; \
+     ifr.ifr_addr.sa_len = sizeof(ifr.ifr_addr); \
      ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr.s_addr = o; \
      if (ioctl(s, SIOCSIFADDR, (caddr_t) &ifr) < 0) { \
  	syslog(LOG_ERR, "ioctl(SIOCSIFADDR): %m"); \
***************
*** 334,342 ****
--- 335,345 ----
      struct ortentry rt; \
      bzero((char *) &rt.rt_dst, sizeof(rt.rt_dst));  \
      rt.rt_dst.sa_family = AF_INET; \
+     rt.rt_dst.sa_len = sizeof(rt.rt_dst); \
      ((struct sockaddr_in *) &rt.rt_dst)->sin_addr.s_addr = h; \
      bzero((char *) &rt.rt_gateway, sizeof(rt.rt_gateway));  \
      rt.rt_gateway.sa_family = AF_INET; \
+     rt.rt_gateway.sa_len = sizeof(rt.rt_gateway); \
      ((struct sockaddr_in *) &rt.rt_gateway)->sin_addr.s_addr = o; \
      rt.rt_flags |= RTF_HOST; \
      syslog(LOG_INFO, "Deleting host route from %x to %x\n", h, o); \
***************
*** 349,357 ****
--- 352,362 ----
      struct rtentry rt; \
      bzero((char *) &rt.rt_dst, sizeof(rt.rt_dst));  \
      rt.rt_dst.sa_family = AF_INET; \
+     rt.rt_dst.sa_len = sizeof(rt.rt_dst); \
      ((struct sockaddr_in *) &rt.rt_dst)->sin_addr.s_addr = h; \
      bzero((char *) &rt.rt_gateway, sizeof(rt.rt_gateway));  \
      rt.rt_gateway.sa_family = AF_INET; \
+     rt.rt_gateway.sa_len = sizeof(rt.rt_gateway); \
      ((struct sockaddr_in *) &rt.rt_gateway)->sin_addr.s_addr = o; \
      rt.rt_flags |= RTF_HOST; \
      if (ioctl(s, SIOCDELRT, (caddr_t) &rt) < 0) { \
***************
*** 368,373 ****
--- 373,379 ----
      strncpy(ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); \
      bzero((char *) &ifr.ifr_addr, sizeof(ifr.ifr_addr));  \
      ifr.ifr_addr.sa_family = AF_INET; \
+     ifr.ifr_addr.sa_len = sizeof(ifr.ifr_addr); \
      ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr.s_addr = m; \
      if (ioctl(s, SIOCSIFNETMASK, (caddr_t) &ifr) < 0) { \
  	syslog(LOG_ERR, "ioctl(SIOCSIFADDR): %m"); \
----------------------------snip snip snip----------------------------------

Good luck to all...
--
Denis Fortin, Principal Consultant		fortin@zap.uniforum.qc.ca
DMR Quebec Inc, (514) 877-3301			lmcdefo@lmc.ericsson.se
		Any opinions in the above text are my own.