Subject: [SIP] About via-receieved:

From: "Bodgey" <[email-masked]>
Date: Wed, 20 Sep 2000 18:47:39 +0530

Hi:
   I have a question. In RFC2543, there write" To prevent this, a proxy
SHOULD check the top-most Via header field to ensure that it contains the
sender's correct network address, as seen from that proxy", I don't know
whether every proxy will do this operation of "CHECK"? How do a proxy can
check that the address of previous hop is correct? There is not a method to
decribe it in RFC2543.

   Would some anwser this question? Thanks!

Bodgey

_______________________________________________
SIP mailing list
[email-masked]
http://lists.bell-labs.com/mailman/listinfo/sip

---

From: Kundan Singh <[email-masked]>
Date: Wed, 20 Sep 2000 10:06:33 -0400 (EDT)

> check that the address of previous hop is correct? There is not a method to

You can use the socket library (if using TCP or UDP) to get
the remote IP address (both accept() and recvfrom() can give that)
and compare it with Top-Via in received request (possibly after
some DNS lookup).

---

From: "Vijay K. Gurbani" <[email-masked]>
Date: Wed, 20 Sep 2000 09:47:45 -0500

Bodgey wrote:
> 
> Hi:
>    I have a question. In RFC2543, there write" To prevent this, a 
> proxy SHOULD check the top-most Via header field to ensure that it 
> contains the sender's correct network address, as seen from that 
> proxy", I don't know whether every proxy will do this operation of 
> "CHECK"? 

Even though it is a SHOULD, it is fairly easy to do; so I would presume
most implementations actually do this.

> How do a proxy can check that the address of previous hop is 
> correct? There is not a method to decribe it in RFC2543.

If the SIP request was received from a UDP socket, recvfrom() system
call has parameters where the source address is stored.  If the SIP 
request was received via a TCP socket, you can figure out the peer's IP 
address during accept() or use getpeername() later.

- vijay
-- 
Vijay K. Gurbani  [email-masked] [email-masked] [email-masked]
Internet Software Group/Intelligent Network and Messaging Systems
Lucent Technologies/Bell Labs Innovations, 263 Shuman Blvd, Rm 1A-413
Naperville, Illinois 60566  Voice: +1 630 224 0216 Fax: +1 630 713 0184