Jason Jiang - Solaris China Team wrote:
> Hi Eric,
>
> I read the code as a learning experience. :-)
> I have a question about your code about ASSERT:
>
> ip.c:
> 28821 ipst = ns->netstack_ip;
> 28822 ASSERT(ipst != NULL);
> 28823 28824 ipst->ips_ip_cgtp_filter_ops = ops;
>
> We know the ASSERT will take effect on debug version only. And it do
> nothing on release version(Am I right?).
Correct.
> The question is, it seems that ipst is possible to be a NULL for you are
> using the ASSERT to check it. How about on release version? Can we say
> it will panic here?
No, the reason I'm using an ASSERT is because netstack_ip can not be
NULL. Thus the ASSERT serves to document that it can't possibly be NULL.
Erik
_______________________________________________
networking-discuss mailing list
[email protected]