X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 19618DC0169 for ; Mon, 30 Jun 2014 05:34:05 +0000 (UTC) Received: by mail-pa0-f41.google.com with SMTP id fb1so7935280pad.14 for ; Sun, 29 Jun 2014 22:34:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=4XnqpaiHn7kkS2ERUQZF2D0BoVTB6Kfc+fOLynBJ3uE=; b=KRbS68tLcUwNOXCDhRr3YfinWbDkBUZhPfgt7rG+0K777usrRsYELKNr2OMIBudaWQ /SmwayuPjaooCpRnildS1YLy3I5fnIRG2SYL3kH9vqYe0CvIjaCby9HPCaynD90YQt10 fwXZnWdvr+DvF+hhuSc38Ybw32Ieq27HHGVdyoMK4i9mqyWR7UcTFfOZk9RpM8gXIH1v ts2fbB0PPR799wh8rsH6zPF/xm4AO+aNdPSD4hOapKvnYZwISivcPul+IrRNgw0+ZBFO eLck0BRkKuTjHiK8D4SRU1vqbWwDjKlHqoACSkc7TPCViPF7t/HQ0RTxANtQFWxnzlIt r4jw== X-Received: by 10.66.169.136 with SMTP id ae8mr49318236pac.14.1404106444235; Sun, 29 Jun 2014 22:34:04 -0700 (PDT) Received: from newbook ([50.0.227.219]) by mx.google.com with ESMTPSA id pu5sm25741488pbb.4.2014.06.29.22.34.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Jun 2014 22:34:03 -0700 (PDT) Date: Sun, 29 Jun 2014 22:34:27 -0700 From: Isaac Dunham To: musl@lists.openwall.com Cc: alpine-devel@lists.alpinelinux.org Subject: [alpine-devel] Re: cups debugging, continued...ugly patch Message-ID: <20140630053426.GC16088@newbook> References: <20140629194829.GA1994@newbook> <20140630001201.GA14838@newbook> <20140630012830.GA16088@newbook> <20140630020311.GD179@brightrain.aerifal.cx> <20140630043512.GB16088@newbook> X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="4Ckj6UjgE2iN1+kY" Content-Disposition: inline In-Reply-To: <20140630043512.GB16088@newbook> User-Agent: Mutt/1.5.23 (2014-03-12) --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Thanks to Rich's comment, I've found a solution that works here. The patch doesn't exactly look nice, though. And yes, once I add this patch I can print using Peter De Wachter's brlaser driver (github.com/pdewacht/brlaser). I'll be sending a patch for main/cups to alpine-devel shortly, and probably packaging brlaser for alpine. HTH, Isaac Dunham --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="socksz.diff" diff --git a/backend/lpd.c b/backend/lpd.c index 6e4ab36..bbffb82 100644 --- a/backend/lpd.c +++ b/backend/lpd.c @@ -1244,6 +1244,7 @@ rresvport_af(int *port, /* IO - Port number to bind to */ { http_addr_t addr; /* Socket address */ int fd; /* Socket file descriptor */ + socklen_t socksz=sizeof(struct sockaddr); /* size of struct sockaddr* */ /* @@ -1260,6 +1261,23 @@ rresvport_af(int *port, /* IO - Port number to bind to */ memset(&addr, 0, sizeof(addr)); addr.addr.sa_family = family; + switch(family) { + case AF_INET: + socksz = sizeof(struct sockaddr_in); + break; +#ifdef AF_INET6 + case AF_INET6: + socksz = sizeof(struct sockaddr_in6); + break; +#endif +#ifdef AF_LOCAL + case AF_LOCAL: + socksz = sizeof(struct sockaddr_un); +#endif + default: + break; + } + /* * Try to bind the socket to a reserved port... */ @@ -1276,7 +1294,7 @@ rresvport_af(int *port, /* IO - Port number to bind to */ * Try binding the port to the socket; return if all is OK... */ - if (!bind(fd, (struct sockaddr *)&addr, sizeof(addr))) + if (!bind(fd, (struct sockaddr *)&addr, socksz)) return (fd); /* --4Ckj6UjgE2iN1+kY-- --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---