From owner-freebsd-questions@FreeBSD.ORG Tue Jul 5 17:24:50 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 684A516A41C for ; Tue, 5 Jul 2005 17:24:50 +0000 (GMT) (envelope-from ml@t-b-o-h.net) Received: from vjofn.tucs-beachin-obx-house.com (vjofn.tucs-beachin-obx-house.com [204.107.90.128]) by mx1.FreeBSD.org (Postfix) with ESMTP id 299B343D49 for ; Tue, 5 Jul 2005 17:24:50 +0000 (GMT) (envelope-from ml@t-b-o-h.net) Received: from himinbjorg.tucs-beachin-obx-house.com (ool-44c511d8.dyn.optonline.net [68.197.17.216]) (authenticated bits=128) by vjofn.tucs-beachin-obx-house.com (8.12.9/8.12.9) with ESMTP id j65HLPXE016362 for ; Tue, 5 Jul 2005 13:21:25 -0400 (EDT) Received: from himinbjorg.tucs-beachin-obx-house.com (localhost.tucs-beachin-obx-house.com [127.0.0.1]) by himinbjorg.tucs-beachin-obx-house.com (8.13.3/8.12.10) with ESMTP id j65Gxm8b009273 for ; Tue, 5 Jul 2005 12:59:48 -0400 (EDT) (envelope-from ml@t-b-o-h.net) Received: (from tbohml@localhost) by himinbjorg.tucs-beachin-obx-house.com (8.13.3/8.13.1/Submit) id j65GxmAK009272 for freebsd-questions@freebsd.org; Tue, 5 Jul 2005 12:59:48 -0400 (EDT) (envelope-from tbohml) From: Tuc at T-B-O-H Message-Id: <200507051659.j65GxmAK009272@himinbjorg.tucs-beachin-obx-house.com> To: freebsd-questions@freebsd.org Date: Tue, 5 Jul 2005 12:59:48 -0400 (EDT) X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: UDP issues over 2K X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2005 17:24:50 -0000 Hi, Working with the people doing the INN port, they are complaining as follows : I wrote a little test program to try sending a packet over a Unix datagram socket. The test program is included below. I ran it on: Debian GNU/Linux (2.4 kernel) Solaris 8 IRIX 6.5 Tru64 4.0F AIX 5.2 FreeBSD 5.4 All of them handled 8KB packet sizes without any trouble except for Tru64 and FreeBSD, which can't handle a byte over 2KB. So I'm afraid that INN is running into (stupidly low) OS-imposed limits that there's no way around without major surgery in how ctlinnd talks to innd. #include #include #include #include #include #define SIZE (8 * 1024) static void server(void) { int in; struct sockaddr_un server; char buffer[SIZE]; size_t i; ssize_t result; fd_set readfds; in = socket(AF_UNIX, SOCK_DGRAM, 0); if (in < 0) { perror("socket"); exit(1); } memset(&server, 0, sizeof(server)); server.sun_family = AF_UNIX; strcpy(server.sun_path, "sock-s"); if (bind(in, (struct sockaddr *) &server, sizeof(server)) < 0) { perror("bind"); exit(1); } FD_ZERO(&readfds); FD_SET(in, &readfds); if (select(in + 1, &readfds, NULL, NULL, NULL) <= 0) { perror("select"); exit(1); } result = recv(in, buffer, sizeof(buffer), 0); if (result < (ssize_t) sizeof(buffer)) { fprintf(stderr, "Only got %ld bytes\n", (long) result); exit(1); } for (i = 0; i < SIZE - 1; i++) if (buffer[i] != 1) { fprintf(stderr, "Bad data at %lu", (unsigned long) i); exit(1); } if (buffer[i] != 2) { fprintf(stderr, "Bad data at %lu", (unsigned long) i); exit(1); } exit(0); } static void client(void) { int out; struct sockaddr_un server; char buffer[SIZE]; ssize_t result; memset(buffer, 1, sizeof(buffer)); buffer[sizeof(buffer) - 1] = 2; out = socket(AF_UNIX, SOCK_DGRAM, 0); memset(&server, 0, sizeof(server)); server.sun_family = AF_UNIX; strcpy(server.sun_path, "sock-s"); if (sendto(out, buffer, sizeof(buffer), 0, (struct sockaddr *) &server, sizeof(server)) < 0) { perror("sendto"); exit(1); } exit(0); } int main(void) { pid_t child; child = fork(); if (child < 0) { perror("fork"); exit(1); } else if (child == 0) { sleep(1); client(); } else { server(); } return 0; } Is this an issue that they aren't doing something right, or is it a config error on my part, or just an OS limitation? Thanks, Tuc