Query local ip address with tdi

The irp of TDI_QUERY_ADDRESS_INFO always returns 0 when querying local ip address whatever
the it is connected or not.

The query of peer’s addresss when connected works well.

Anyone has a clue ?

Thanks,

Matt Wu

Matt Wu wrote:

The irp of TDI_QUERY_ADDRESS_INFO always returns 0 when querying local
ip address whatever the it is connected or not.

Given the TDI_ADDRESS_IP structure used for opening an address object, a
value of 0 for the sin_port field
informs the transport that the client needs a dynamic allocation of the
port number. So it will assign a value above 1023.
A value of 0 for the in_addr field means that the client doesn’t
associate this object to a particular IP address. The transport
selects which one to use when traffic is directed to the selected port.
The TDI_QUERY_ADDRESS_INFO request for an address object will return
non-zero for the port and the value specified
by the client in the create request.
On the other hand, a TDI_QUERY_ADDRESS_INFO request on the connection
object will return the local address and port
combination used for that particular connection.

The query of peer’s addresss when connected works well.

Anyone has a clue ?

Thanks,

Matt Wu


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@bitdefender.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Ignorance more frequently begets confidence than does knowledge.
— Charles Darwin


This message was scanned for spam and viruses by BitDefender.
For more information please visit http://linux.bitdefender.com/

Hi Andrei,

Thank you very much to clarify the problem!

I misunderstood the query on the Connection Object. I thought before it should be the
remote peer’s ip address.

I just had a try on it: The query call on the connection object just returns the Local Ip
Address.

Thank you again for your help.

Matt

“Andrei Zlate-Podani” wrote: xxxxx@ntdev…

> Given the TDI_ADDRESS_IP structure used for opening an address object, a
> value of 0 for the sin_port field
> informs the transport that the client needs a dynamic allocation of the
> port number. So it will assign a value above 1023.
> A value of 0 for the in_addr field means that the client doesn’t
> associate this object to a particular IP address. The transport
> selects which one to use when traffic is directed to the selected port.
> The TDI_QUERY_ADDRESS_INFO request for an address object will return
> non-zero for the port and the value specified
> by the client in the create request.
> On the other hand, a TDI_QUERY_ADDRESS_INFO request on the connection
> object will return the local address and port
> combination used for that particular connection.