summaryrefslogtreecommitdiff
path: root/sys/netinet6
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2023-05-12 12:42:17 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2023-05-12 12:42:17 +0000
commit073a75d7e6690937bc2e246f3ffeb9c841c4717f (patch)
tree86241369dcd6a232f505afad051fd5cd4238f2b5 /sys/netinet6
parentc235e8e2a6cabe338b8e9270de8a19910211cc2e (diff)
Make access to rt_llinfo consistent and remove needless initialisation.
OK mvs@
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/nd6.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index ea91d421012..fd3836a3178 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6.c,v 1.278 2023/05/08 13:14:21 bluhm Exp $ */
+/* $OpenBSD: nd6.c,v 1.279 2023/05/12 12:42:16 bluhm Exp $ */
/* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */
/*
@@ -527,6 +527,7 @@ nd6_lookup(const struct in6_addr *addr6, int create, struct ifnet *ifp,
if (rt == NULL) {
if (create && ifp) {
struct rt_addrinfo info;
+ struct llinfo_nd6 *ln;
struct ifaddr *ifa;
int error;
@@ -556,11 +557,9 @@ nd6_lookup(const struct in6_addr *addr6, int create, struct ifnet *ifp,
rtableid);
if (error)
return (NULL);
- if (rt->rt_llinfo != NULL) {
- struct llinfo_nd6 *ln =
- (struct llinfo_nd6 *)rt->rt_llinfo;
+ ln = (struct llinfo_nd6 *)rt->rt_llinfo;
+ if (ln != NULL)
ln->ln_state = ND6_LLINFO_NOSTATE;
- }
} else
return (NULL);
}
@@ -741,7 +740,7 @@ void
nd6_rtrequest(struct ifnet *ifp, int req, struct rtentry *rt)
{
struct sockaddr *gate = rt->rt_gateway;
- struct llinfo_nd6 *ln = (struct llinfo_nd6 *)rt->rt_llinfo;
+ struct llinfo_nd6 *ln;
struct ifaddr *ifa;
struct in6_ifaddr *ifa6;
@@ -1027,10 +1026,10 @@ void
nd6_cache_lladdr(struct ifnet *ifp, const struct in6_addr *from, char *lladdr,
int lladdrlen, int type, int code)
{
- struct rtentry *rt = NULL;
- struct llinfo_nd6 *ln = NULL;
+ struct rtentry *rt;
+ struct llinfo_nd6 *ln;
int is_newentry;
- struct sockaddr_dl *sdl = NULL;
+ struct sockaddr_dl *sdl;
int do_update;
int olladdr;
int llchange;
@@ -1257,7 +1256,7 @@ nd6_resolve(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m,
{
struct sockaddr_dl *sdl;
struct rtentry *rt;
- struct llinfo_nd6 *ln = NULL;
+ struct llinfo_nd6 *ln;
struct in6_addr saddr6;
time_t uptime;
int solicit = 0;