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

Winsock API issue (DGRAM connect / sendto failure)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Untriaged
    • Priority: Major
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: Networking
    • Labels:

      Description

      While working on porting SAMBA4 via Cygwin 2.5.2 I found that UDP messaging would not work when running on ReactOS 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. connect.c
          27 kB
        2. tdiconn.c
          9 kB
        3. UDP_Client.c
          2 kB
        4. UDP_Client.exe
          153 kB
        5. UDP_Server.c
          2 kB
        6. UDP_Server.exe
          149 kB
        7. write.c
          53 kB

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                bugdude bugdude
              • Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: