ChangeSet 1.1982.148.13, 2005/03/03 14:38:18+09:00, [EMAIL PROTECTED] [IPV6] NDISC: Ensure to send redirects even if we don't know target's lladdr.
ndisc.c | 23 +++++++++++------------ 1 files changed, 11 insertions(+), 12 deletions(-) diff -Nru a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c --- a/net/ipv6/ndisc.c 2005-03-12 20:45:54 -08:00 +++ b/net/ipv6/ndisc.c 2005-03-12 20:45:54 -08:00 @@ -1332,6 +1332,7 @@ int rd_len; int err; int hlen; + u8 ha_buf[MAX_ADDR_LEN], *ha = NULL; dev = skb->dev; @@ -1368,16 +1369,14 @@ } if (dev->addr_len) { - if (neigh->nud_state&NUD_VALID) { - len += ndisc_opt_addr_space(dev); - } else { - /* If nexthop is not valid, do not redirect! - We will make it later, when will be sure, - that it is alive. - */ - dst_release(dst); - return; - } + read_lock_bh(&neigh->lock); + if (neigh->nud_state & NUD_VALID) { + memcpy(ha_buf, neigh->ha, dev->addr_len); + read_unlock_bh(&neigh->lock); + ha = ha_buf; + len += ndisc_opt_addr_space(dev); + } else + read_unlock_bh(&neigh->lock); } rd_len = min_t(unsigned int, @@ -1422,8 +1421,8 @@ * include target_address option */ - if (dev->addr_len) - opt = ndisc_fill_addr_option(opt, ND_OPT_TARGET_LL_ADDR, neigh->ha, + if (ha) + opt = ndisc_fill_addr_option(opt, ND_OPT_TARGET_LL_ADDR, ha, dev->addr_len, dev->type); /* - To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html