tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Remove meaningless RTF_UP check
Hi,
There is a questionable code in ip_hresolv_output:
http://nxr.netbsd.org/xref/src/sys/netinet/ip_output.c#230
As the comment says, checking RTF_UP and doing re-rtalloc1
is questionable. IIUC, it's meaningless because:
- An obtained rtentry is ensured that it's always RTF_UP
by rtcache, rtalloc1 and rtlookup. If the rtentry isn't changed
(RTF_UP gets dropped) during processing, the check should be
unnecessary
- Even if not, i.e., an obtained rtentry can be changed during
processing, checking only at the point doesn't help; the
rtentry can be changed after the check
So I think we can get rid of it. Of course, in the future
we should ensure that RTF_UP isn't dropped if someone
is using it somehow once we remove the global locks.
Here is a patch:
http://www.netbsd.org/~ozaki-r/remove-RTF_UP-check.diff
Any comments?
ozaki-r
Home |
Main Index |
Thread Index |
Old Index