I'd like to remove this 16 years old define. We always used the correct
behavior. My goal is to reduce the uses of if_get().
Ok?
Index: netinet6/frag6.c
===
RCS file: /cvs/src/sys/netinet6/frag6.c,v
retrieving revision 1.60
diff -u -p -r1.60 frag6.c
--- netinet6/frag6.c16 Jun 2015 11:09:40 - 1.60
+++ netinet6/frag6.c7 Jul 2015 13:46:18 -
@@ -53,13 +53,6 @@
#include netinet/icmp6.h
#include netinet/ip.h/* for ECN definitions */
-/*
- * Define it to get a correct behavior on per-interface statistics.
- * You will need to perform an extra routing table lookup, per fragment,
- * to do it. This may, or may not be, a performance hit.
- */
-#define IN6_IFSTAT_STRICT
-
void frag6_freef(struct ip6q *);
static int ip6q_locked;
@@ -172,10 +165,8 @@ frag6_input(struct mbuf **mp, int *offp,
int first_frag = 0;
int fragoff, frgpartlen;/* must be larger than u_int16_t */
struct ifnet *dstifp;
-#ifdef IN6_IFSTAT_STRICT
struct sockaddr_in6 dst;
struct rtentry *rt;
-#endif
u_int8_t ecn, ecn0;
ip6 = mtod(m, struct ip6_hdr *);
@@ -184,7 +175,6 @@ frag6_input(struct mbuf **mp, int *offp,
return IPPROTO_DONE;
dstifp = NULL;
-#ifdef IN6_IFSTAT_STRICT
/* find the destination interface of the packet. */
memset(dst, 0, sizeof(dst));
dst.sin6_family = AF_INET6;
@@ -200,11 +190,6 @@ frag6_input(struct mbuf **mp, int *offp,
rtfree(rt);
rt = NULL;
}
-#else
- /* we are violating the spec, this is not the destination interface */
- if ((m-m_flags M_PKTHDR) != 0)
- dstifp = if_get(m-m_pkthdr.ph_ifidx);
-#endif
/* jumbo payload can't contain a fragment header */
if (ip6-ip6_plen == 0) {