diff options
author | melifaro <melifaro@FreeBSD.org> | 2015-08-31 05:03:36 +0000 |
---|---|---|
committer | melifaro <melifaro@FreeBSD.org> | 2015-08-31 05:03:36 +0000 |
commit | 3f9699bcfe4422e0ba027d297154a947ac656338 (patch) | |
tree | 35b1c562c5d615f690ec265eeecf5ece392b7c3c /sys/net/if_llatbl.c | |
parent | 58e5250bc17f63c7b59be2af81b0e50067fa3415 (diff) | |
download | FreeBSD-src-3f9699bcfe4422e0ba027d297154a947ac656338.zip FreeBSD-src-3f9699bcfe4422e0ba027d297154a947ac656338.tar.gz |
Simplify lla_rt_output()/nd6_add_ifa_lle() by setting lle state in
alloc handler, based on flags.
Diffstat (limited to 'sys/net/if_llatbl.c')
-rw-r--r-- | sys/net/if_llatbl.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/sys/net/if_llatbl.c b/sys/net/if_llatbl.c index 38f1c1f..1e246d4 100644 --- a/sys/net/if_llatbl.c +++ b/sys/net/if_llatbl.c @@ -592,7 +592,10 @@ lla_rt_output(struct rt_msghdr *rtm, struct rt_addrinfo *info) switch (rtm->rtm_type) { case RTM_ADD: /* Add static LLE */ - lle = lltable_alloc_entry(llt, 0, dst); + laflags = 0; + if (rtm->rtm_rmx.rmx_expire == 0) + laflags = LLE_STATIC; + lle = lltable_alloc_entry(llt, laflags, dst); if (lle == NULL) return (ENOMEM); @@ -600,22 +603,8 @@ lla_rt_output(struct rt_msghdr *rtm, struct rt_addrinfo *info) if ((rtm->rtm_flags & RTF_ANNOUNCE)) lle->la_flags |= LLE_PUB; lle->la_flags |= LLE_VALID; -#ifdef INET6 - /* - * ND6 - */ - if (dst->sa_family == AF_INET6) - lle->ln_state = ND6_LLINFO_REACHABLE; -#endif - /* - * NB: arp and ndp always set (RTF_STATIC | RTF_HOST) - */ + lle->la_expire = rtm->rtm_rmx.rmx_expire; - if (rtm->rtm_rmx.rmx_expire == 0) { - lle->la_flags |= LLE_STATIC; - lle->la_expire = 0; - } else - lle->la_expire = rtm->rtm_rmx.rmx_expire; laflags = lle->la_flags; /* Try to link new entry */ |