I have a TDI client driver that generates a DHCP Inform in response to
a ClientPnPAddNetAddress callback notification.
It creates an address file object against \Device\Udp that specifies
the address we were just informed of, and then we construct a
TDI_CONNECTION_INFORMATION.RemoteAddress that describes the IP
broadcast address (FF.FF.FF.FF) for TdiBuildSendDatagram and then call
for the send.
The packet presented on the wire appears perfect; IP source address
and port are specified in the EA passed to ZwCreateFile, destination
is IP-level broadcast and port specified, and contents are the valid
DHCP Inform supplied.
But this exact packet gets sent out over all interfaces, not just the
interface that corresponds to the source address provided.
(e.g. If I have a machine multi-homed to a 10.xx.xx.xx and a
172.xx.xx.xx network and I was just notified of the 172.xx.xx.xx
address. Although the DHCP Inform does go out over the 172.xx.xx.xx
interface, the exact same packet goes out the 10.xx.xx.xx interface
too, still with the 172.xx.xx.xx IP source address.)
It almost looks like the packet is being “routed” by the workstation,
possibly as a result of the destination being the broadcast address.
But the intention was for this DHCP Inform request to only be
presented on the interface that had just come up.
When Microsoft’s own DHCPCSVC makes an Inform request it only appears
on the interface you would expect, but they’re going through Winsock
and AFD to TCPIP directly, not via TDI, so a comparison of “how” isn’t
straight forward.
Anyone know whether my expectation isn’t correct that having specified
the source address to TDI would limit which interface the UDP datagram
was sent from, or any other way in which my desired goal of sending
this request via TDI only on the one interface could be achieved?
Alan Adams