[gstreamer-bugs] [Bug 638723] New: Fix for "getnameinfo failed" in gst_rtsp_client_accept

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed Jan 5 01:00:18 PST 2011


https://bugzilla.gnome.org/show_bug.cgi?id=638723
  GStreamer | gst-rtsp-server | git

           Summary: Fix for "getnameinfo failed" in gst_rtsp_client_accept
    Classification: Desktop
           Product: GStreamer
           Version: git
        OS/Version: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-rtsp-server
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: jonas at hallerud.se
         QAContact: gstreamer-bugs at lists.sourceforge.net
      GNOME target: ---
     GNOME version: ---


While embedding the rtsp server in my Android app (long story...) I had an
issue when clients (only local) connected. The log message was "getnameinfo
failed: Unknown error (0)".

I traced the issue to 
gst_rtsp_client_accept in rtsp-client.c

First getsockname is called, which sets the addr struct and addrlen. addrlen
now correctly describes addr. Then addrlen is reset to sizeof (addr) and
getnameinfo is called. Since addrlen is wrong the call fails.

Simply commenting out "addrlen = sizeof (addr);" before the call to getnameinfo
solves the problem.

The size of the struct is platform specific and I think it's wrong to always
set it to sizeof (addr).

Here is a snippet with my changes (just added two slashes on 1743)

gboolean
gst_rtsp_client_accept (GstRTSPClient * client, GIOChannel * channel)

1737  addrlen = sizeof (addr);
1738  if (getsockname (fd, (struct sockaddr *) &addr, &addrlen) < 0)
1739    goto getpeername_failed;
1740
1741  client->is_ipv6 = addr.ss_family == AF_INET6;
1742
1743  //addrlen = sizeof (addr);
1744  if (getnameinfo ((struct sockaddr *) &addr, addrlen, ...

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.




More information about the Gstreamer-bugs mailing list