svn commit: r225947 - head/sys/netinet

Gleb Smirnoff glebius at FreeBSD.org
Sun Oct 9 19:47:35 UTC 2011


  Qing,

  [cced Bjoern as reviewer]

On Mon, Oct 03, 2011 at 07:51:19PM +0000, Qing Li wrote:
Q> Author: qingli
Q> Date: Mon Oct  3 19:51:18 2011
Q> New Revision: 225947
Q> URL: http://svn.freebsd.org/changeset/base/225947
Q> 
Q> Log:
Q>   A system may have multiple physical interfaces, all of which are on the
Q>   same prefix. Since a single route entry is installed for the prefix
Q>   (without RADIX_MPATH), incoming packets on the interfaces that are not
Q>   associated with the prefix route may trigger an error message about
Q>   unable to allocation LLE entry, and fails L2. This patch makes sure a
Q>   valid route is present in the system, and allow the aforementioned
Q>   condition to exist and treats as valid.
Q>   
Q>   Reviewed by:	bz
Q>   MFC after:	5 days

  this commit together with r225946 makes the in_lltable_rtcheck()
quite difficult to understand.

  What confuses me most, is that in lines 1435-1445 you are
assigning error to a positive value, BUT proceeding further
with function. Well, after third review it is clear, that
next if() case would definitely be true, and you would proceed
with return. But that is difficult to see from first glance.

I'd suggest to remove error variable, return immediately in
all error cases, and also the RTF_GATEWAY check can be shifted up,
since it is the most simple and the most usual to be true.

Also, in this commit you really do not need the __DECONST hacks.

Here is a snap, only compile-tested patch.

-- 
Totus tuus, Glebius.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: in.c.diff
Type: text/x-diff
Size: 2520 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20111009/bfb8cbfa/in.c.bin


More information about the svn-src-head mailing list