diff options
-rw-r--r-- | sys/netinet/ip_output.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 9c0f974..96e1e5f 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -961,10 +961,12 @@ sendorfree: /* clean ipsec history once it goes out of the node */ ipsec_delaux(m); #endif - if (error == 0 && ia) { + if (error == 0) { /* Record statistics for this interface address. */ - ia->ia_ifa.if_opackets++; - ia->ia_ifa.if_obytes += m->m_pkthdr.len; + if (ia != NULL) { + ia->ia_ifa.if_opackets++; + ia->ia_ifa.if_obytes += m->m_pkthdr.len; + } error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst, ro->ro_rt); |