lpd dies with errno 99 (EADDRNOTAVAIL)

lpd dies with errno 99 (EADDRNOTAVAIL)

Post by raa.. » Mon, 11 Apr 1994 18:20:31



Whenever I start lpd it dies immediately with the following error:

Apr  5 07:41:12 netland lpd[61]: bind: Cannot assign requested address

errno value is 99, (EADDRNOTAVAIL)

The author of the Printing-HOWTO could not help me.

-- Ron

--
NetLand - Internet BBS - DIRECT INTERNET CONNECTION - +31-(0)20-6940350
gopher, irc, ftp, telnet from a BBS. Unix accounts too.
--
NetLand - Internet BBS - DIRECT INTERNET CONNECTION - +31-(0)20-6940350
gopher, irc, ftp, telnet from a BBS. Unix accounts too.

 
 
 

lpd dies with errno 99 (EADDRNOTAVAIL)

Post by Michael Rie » Tue, 12 Apr 1994 08:43:32



> Whenever I start lpd it dies immediately with the following error:
> Apr  5 07:41:12 netland lpd[61]: bind: Cannot assign requested address
> errno value is 99, (EADDRNOTAVAIL)

There's a bug in certain versions of lpd - it calls bind(2) with an
improperly initialized argument (the `struct sockaddr_in' thingy).
Here's a fix:

--- chainsaw ---
--- Orig/lpr/lpd/lpd.c  Fri Apr 19 22:06:32 1991

                        mcleanup();
                }
                sin.sin_family = AF_INET;
+               sin.sin_addr.s_addr = INADDR_ANY;
                sin.sin_port = sp->s_port;
                if (bind(finet, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
                        syslog(LOG_ERR, "bind: %m");
--- chainsaw ---

Ciao,
--

 Universit"at Hannover
 Institut f"ur Fertigungstechnik und Spanende Werkzeugmaschinen
 Schlosswender Str. 5                  30159 Hannover (Germany)
 ... beware the storm that gathers here ("The Prophet's Song")