From: bluhm Date: Mon, 18 Jul 2016 19:50:49 +0000 (+0000) Subject: Kill the rtableid variable in ip6_input(). It does not make sense X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8f88128b3be833c5c34f15adb2560fcb4f3e5be5;p=openbsd Kill the rtableid variable in ip6_input(). It does not make sense to store a field in an extra variable that is only accessed twice. OK mpi@ --- diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 92077dbd458..882d660c77e 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_input.c,v 1.163 2016/07/14 14:39:12 mpi Exp $ */ +/* $OpenBSD: ip6_input.c,v 1.164 2016/07/18 19:50:49 bluhm Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -198,7 +198,6 @@ ip6_input(struct mbuf *m) struct in6_addr odst; #endif int srcrt = 0, isanycast = 0; - u_int rtableid = 0; ifp = if_get(m->m_pkthdr.ph_ifidx); if (ifp == NULL) @@ -413,8 +412,6 @@ ip6_input(struct mbuf *m) goto hbhcheck; } - rtableid = m->m_pkthdr.ph_rtableid; - /* * Unicast check */ @@ -422,7 +419,7 @@ ip6_input(struct mbuf *m) !ISSET(ip6_forward_rt.ro_rt->rt_flags, RTF_MPATH) && IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst, &ip6_forward_rt.ro_dst.sin6_addr) && - rtableid == ip6_forward_rt.ro_tableid) + m->m_pkthdr.ph_rtableid == ip6_forward_rt.ro_tableid) ip6stat.ip6s_forward_cachehit++; else { if (ip6_forward_rt.ro_rt) { @@ -436,7 +433,7 @@ ip6_input(struct mbuf *m) ip6_forward_rt.ro_dst.sin6_len = sizeof(struct sockaddr_in6); ip6_forward_rt.ro_dst.sin6_family = AF_INET6; ip6_forward_rt.ro_dst.sin6_addr = ip6->ip6_dst; - ip6_forward_rt.ro_tableid = rtableid; + ip6_forward_rt.ro_tableid = m->m_pkthdr.ph_rtableid; ip6_forward_rt.ro_rt = rtalloc_mpath( sin6tosa(&ip6_forward_rt.ro_dst),