Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-17521

Winsock API issue (DGRAM connect / sendto failure)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • Networking

    Description

      SYNOPSIS - some ported socket SW opens/connects socket then calls sendto() with socket nbr and no target address. Fails in ROS but works in 2003

      PR 5476 resolves this issue but was not approved. I'm not aware of any applications blocked by this issue.

      While working on porting SAMBA4 via Cygwin 2.5.2 I found that UDP messaging would not work when running on ReactOS 0.4.15-dev-2039-gca74467. I traced the problem to the use of a slightly uncommon calling sequence for winsock functions. basically the application calls socket() to create a datagram socket, then calls connect() specifying a RemoteAddress, and later calls Sendto() without providing a RemoteAddress value. This sequence works fine under Windows 10, so apparently Windows is retaining the RemoteAddress value from the Connect() call and associating it with the socket even though a connection is not actually made. ReactOS is not storing the RemoteAddress in association with the socket for connectionless mode calls. I do not know if this functionality is found in windows at winsock, AFD, TDI, or the LAN layer, but currently it does not exist in ReactOS so the application fails. I have attached a small test application that demonstrates the issue in source form (I'll attach binaries if it allows me to). I did develop workaround code in the AfdStreamSocketconnect() and AfdPacketSocketWriteData() functions that handles this by storing the information in FCB->ConnectCallInfo->RemoteAddress FCB->ConnectReturnInfo->RemoteAddress and using it if the function to populate TargetAddress fails, but I'm not sure that is the proper way to handle this..

      NOTE: the binaries were built using Delphi by porting the code because I didn't have a working C compiler, but I just passed the code through a converter, patched it up, and added some comments.. It is functionally equivalent.

      Attachments

        1. 4.15-afd.zip
          186 kB
        2. CORE-17521-fail.png
          CORE-17521-fail.png
          155 kB
        3. tdiconn.c
          9 kB
        4. UDP_Client.c
          2 kB
        5. UDP_Client.exe
          153 kB
        6. UDP_Server.c
          2 kB
        7. UDP_Server.exe
          149 kB
        8. write.c
          53 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bugdude bugdude
              Votes:
              4 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: