*BSD News Article 16514


Return to BSD News archive

Newsgroups: comp.os.386bsd.bugs
Path: sserve!newshost.anu.edu.au!munnari.oz.au!constellation!osuunx.ucc.okstate.edu!moe.ksu.ksu.edu!crcnis1.unl.edu!wupost!uunet!newsflash.concordia.ca!cumin.telecom.uqam.ca!CC.UMontreal.CA!IRO.UMontreal.CA!zap!fortin
From: fortin@zap.uniforum.qc.ca (Denis Fortin)
Subject: Re: PPP crash and burn.
Organization: zap, Montreal, QC, Canada
Summary: ppp-1.2: the bind problem is solved
References: <1thd31$gbj@turin.research.otc.com.au>
Message-ID: <C7MqE4.8uy@zap.uniforum.qc.ca>
Keywords: PPP, 386bsd 0.1 + 0.2.3
Date: Wed, 26 May 1993 10:27:25 GMT
Lines: 85

In article <1thd31$gbj@turin.research.otc.com.au> alexk@swdev.research.otc.com.au (Alex Kowalenko) writes:
>I've installled the PPP code for 386bsd and suns from ppp-1.2.tar.z and 
>compiled it with the patchkit 0.2.3, into the kernel and installed into 
>the kernel on the sun at work.

>Problems: 
>ftp - I can connect to the work machine but when I attempt to perfrom a ls, it comes
>back with "can't bind address".

Ah ha!  I solved that one about a month ago...  (I believe I posted the
diffs at the time?!?)

There is a problem in the way the PPP code registers the IP addresses on
both ends of the connections into the kernel's interface structures: PPP
doesn't fill in the "size of structure" field of the IP address, which
means that bind will never find the addresses (sigh).

The diffs for that problem appear below...

>Once I started up ppp without the X-server, without X and I saw a series 
>of messages of the type, repeated a number of times
>
>	missing UI, got(0x83)
>	ppp: to short 1,

Hmmm.  That's odd, I've not seen that one.  I'd venture it's probably
something in your set-up.

But anyway, install the following patch and then try ftp or ping and
let us know how it turns out!

Happy PPPing!

Denis, fortin@zap.uniforum.qc.ca
-----------------------------8<---------------8<-----------------------
*** /tmp/pppd.h-orig	Wed May 26 06:16:24 1993
--- /tmp/pppd.h	Wed May 26 06:17:11 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"); \