From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16221 invoked by alias); 6 Dec 2013 10:03:55 -0000 Mailing-List: contact ecos-patches-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-patches-owner@ecos.sourceware.org Received: (qmail 16207 invoked by uid 89); 6 Dec 2013 10:03:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_20,RCVD_IN_DNSWL_LOW,T_FRT_STOCK2 autolearn=ham version=3.3.2 X-HELO: mail.ecoscentric.com Received: from Unknown (HELO mail.ecoscentric.com) (212.13.207.197) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 06 Dec 2013 10:03:52 +0000 Received: from localhost (hagrid.ecoscentric.com [127.0.0.1]) by mail.ecoscentric.com (Postfix) with ESMTP id 2A21F468000F for ; Fri, 6 Dec 2013 10:03:43 +0000 (GMT) Received: from mail.ecoscentric.com ([127.0.0.1]) by localhost (hagrid.ecoscentric.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Lj2Go-ELQY21; Fri, 6 Dec 2013 10:03:33 +0000 (GMT) From: bugzilla-daemon@bugs.ecos.sourceware.org To: ecos-patches@ecos.sourceware.org Subject: [Bug 1001656] FreeBSD: add AF_PACKET socket familiy Date: Fri, 06 Dec 2013 10:03:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: eCos X-Bugzilla-Component: Patches and contributions X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: daniel.zebralla@arcor.de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: high X-Bugzilla-Assigned-To: unassigned@bugs.ecos.sourceware.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://bugs.ecos.sourceware.org/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-12/txt/msg00000.txt.bz2 Please do not reply to this email, use the link below. http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001656 --- Comment #11 from D.Zebralla --- I stumbled across a problem sending normal UDP packets with this patch. I'm not sure whether the problem is introduced by this patch or our way of opening a UDP socket is wrong. I'm referring to this change of the patch: diff -Nur ecos-cvs-120723/packages/net/bsd_tcpip/current/src/sys/kern/sockio.c ecos/packages/net/bsd_tcpip/current/src/sys/kern/sockio.c --- ecos-cvs-120723/packages/net/bsd_tcpip/current/src/sys/kern/sockio.c 2009-01-29 18:49:56.000000000 +0100 +++ ecos/packages/net/bsd_tcpip/current/src/sys/kern/sockio.c 2012-08-02 10:15:18.000000000 +0200 @@ -234,7 +234,8 @@ { int error; sockaddr sa1=*sa; - + sa1.sa_len = len; + error = sobind((struct socket *)fp->f_data, (sockaddr *)&sa1, 0); return error; } We're starting the UDP connection like this (error checking omitted for readability): memset(&hints, 0, sizeof hints); // make sure the struct is empty hints.ai_family = AF_INET6; // IPv6 hints.ai_socktype = SOCK_DGRAM; // UDP hints.ai_flags = AI_PASSIVE; // fill in my IP for me getaddrinfo(NULL, "12345", &hints, &servinfo); acceptSocket = socket(servinfo->ai_family, servinfo->ai_socktype, servinfo->ai_protocol); setsockopt(acceptSocket, SOL_SOCKET, SO_REUSEADDR, (char *)&on,sizeof(on); bind(acceptSocket, servinfo->ai_addr, servinfo->ai_addrlen); servinfo->ai_addrlen was set to 32 Bytes (size of struct sockaddr) inside alloc_addrinfo-function: struct sockaddr * sa; [...] nai->ai_addrlen = sizeof(*sa); Due to the patch inside bsd_bind sa1.sa_len is now changed from 28 (size of struct sockaddr_in6) to 32 (size of struct sockaddr). After finally arriving in the udp6_output function, the following sanity check now fails because addr6->m_len is now 32 instead of 28: if (addr6) { [...] sin6 = mtod(addr6, struct sockaddr_in6 *); if (addr6->m_len != sizeof(*sin6)) return(EINVAL); [...] } Can someone please confirm this or point me to errors we may have made? -- You are receiving this mail because: You are on the CC list for the bug.