For all ZRP packets, it decrements the ttl value at the recv function.
he(coder) asserts the [hdrip->ttl() -= 1;] statement with another variable
'jem'. That's it!!!
Now if ttl value is less than 0, then it simply drops the packet. [which
cannot happen]


Batbold Toiruul-2 wrote:
> 
> 
> Dear ns users,
> from zrp.cc code, Could anyone explain below piece of code to me, please?
> 
> if (hdrc->ptype() == PT_ZRP) {
>     jem =  hdrip->ttl();
>     hdrip->ttl() -= 1;
>     assert(jem == (hdrip->ttl() + 1) );
>     if (hdrip->ttl() < 0) {
>       zdrop(p, DROP_RTR_TTL);
>       return;
>     }
> 
> 

-- 
View this message in context: 
http://www.nabble.com/hello-%28ZRP%29-tp20561055p22136559.html
Sent from the ns-users mailing list archive at Nabble.com.

Reply via email to