[EMAIL PROTECTED] wrote:

> So, to use an example of IP code today, code like this:
>        len_needed += ipst->ips_ip_icmp_return;
>        msg_len = msgdsize(mp);
>        if (msg_len > len_needed) {
>                (void) adjmsg(mp, len_needed - msg_len);
>                msg_len = len_needed;
>        }
> 
> should become:
>        len_needed += ipst->ips_ip_icmp_return;
>        msg_len = ntohs(ipha->ipha_length);
>        if (msg_len > len_needed) {
>                (void) adjmsg(mp, len_needed - msg_len);
>                msg_len = len_needed;
>        }
> 
> ...which I think is safe.  There are a few others scattered around but...

That should work.
But if we are sending so many ICMP errors that this is a significant 
performance issue, then there would be other problems. (And the ICMP 
errors are rate limited.)

    Erik
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to