CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 1 of 1

Thread: Strange bind behavior on multihome system

  1. #1
    Join Date
    May 2008

    Strange bind behavior on multihomed system

    Hi guys,

    I'm actually programming in perl but believe this is a Windows programming gotcha.

    On a multihomed system I am sending packets over a raw socket. If I bind to an IP address with a higher metric in the route table, the packet actually goes out an interface with a lower metric in the route table. The IP src addr in the packet is still the bound IP address. I think I am hitting the route feature as described in the following.

    Quoted from above link:

    "Even if you call bind() to bind the socket to a specific local address (which means connection manager's AutoLSP is not associated with the socket), still your packets on this socket are subject to the routing decision in terms of choosing which physical interface will be used. "

    Does anyone know if this is the case? Is there anyway around this? I'm trying to use Pcap to grab packets and am finding it impossible since my packets are going out a different interface than I expect!



    [Added] This is expected behavior, see "Windows Socket Connection from a Multiple-Homed Computer" at
    posted by MikeAThon in "Local socket binding on multihomed host in Windows XP does not work" thread.

    Still don't know if there is a workaround...
    Last edited by raboyd; May 5th, 2008 at 08:04 PM. Reason: Add partial solution

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)