public inbox for ecos-bugs@sourceware.org help / color / mirror / Atom feed
From: bugzilla-daemon@bugs.ecos.sourceware.org To: unassigned@bugs.ecos.sourceware.org Subject: [Bug 1001656] FreeBSD: add AF_PACKET socket familiy Date: Fri, 06 Dec 2013 15:38:00 -0000 [thread overview] Message-ID: <bug-1001656-777-zKIReCoX88@http.bugs.ecos.sourceware.org/> (raw) In-Reply-To: <bug-1001656-777@http.bugs.ecos.sourceware.org/> 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 <daniel.zebralla@arcor.de> --- 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 the assignee for the bug.
next prev parent reply other threads:[~2013-12-06 10:04 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-08-17 13:51 [Bug 1001656] New: " bugzilla-daemon 2012-08-17 13:54 ` [Bug 1001656] " bugzilla-daemon 2012-08-17 15:12 ` bugzilla-daemon 2012-09-14 14:08 ` bugzilla-daemon 2013-06-25 17:11 ` bugzilla-daemon 2013-07-15 12:01 ` bugzilla-daemon 2013-07-23 18:48 ` bugzilla-daemon 2013-11-26 10:21 ` bugzilla-daemon 2013-12-01 23:55 ` bugzilla-daemon 2013-12-06 15:38 ` bugzilla-daemon [this message] 2013-12-08 23:55 ` bugzilla-daemon 2013-12-15 2:00 ` bugzilla-daemon 2014-01-21 16:46 ` bugzilla-daemon 2014-01-22 7:46 ` bugzilla-daemon 2014-01-31 10:39 ` bugzilla-daemon 2014-01-31 10:41 ` bugzilla-daemon 2014-01-31 10:43 ` bugzilla-daemon 2014-01-31 10:44 ` bugzilla-daemon 2014-01-31 10:51 ` bugzilla-daemon 2015-06-10 8:48 ` bugzilla-daemon 2015-06-10 8:53 ` bugzilla-daemon
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-1001656-777-zKIReCoX88@http.bugs.ecos.sourceware.org/ \ --to=bugzilla-daemon@bugs.ecos.sourceware.org \ --cc=unassigned@bugs.ecos.sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).