Page MenuHomeFreeBSD

D13989.id.diff
No OneTemporary

D13989.id.diff

Index: head/sys/net/route.h
===================================================================
--- head/sys/net/route.h
+++ head/sys/net/route.h
@@ -416,6 +416,14 @@
} \
} while (0)
+#define RO_INVALIDATE_CACHE(ro) do { \
+ RO_RTFREE(ro); \
+ if ((ro)->ro_lle != NULL) { \
+ LLE_FREE((ro)->ro_lle); \
+ (ro)->ro_lle = NULL; \
+ } \
+ } while (0)
+
/*
* Validate a cached route based on a supplied cookie. If there is an
* out-of-date cache, simply free it. Update the generation number
@@ -424,14 +432,7 @@
#define RT_VALIDATE(ro, cookiep, fibnum) do { \
rt_gen_t cookie = RT_GEN(fibnum, (ro)->ro_dst.sa_family); \
if (*(cookiep) != cookie) { \
- if ((ro)->ro_rt != NULL) { \
- RTFREE((ro)->ro_rt); \
- (ro)->ro_rt = NULL; \
- } \
- if ((ro)->ro_lle != NULL) { \
- LLE_FREE((ro)->ro_lle); \
- (ro)->ro_lle = NULL; \
- } \
+ RO_INVALIDATE_CACHE(ro); \
*(cookiep) = cookie; \
} \
} while (0)
Index: head/sys/netinet/in_pcb.c
===================================================================
--- head/sys/netinet/in_pcb.c
+++ head/sys/netinet/in_pcb.c
@@ -1319,9 +1319,7 @@
if (inp->inp_moptions != NULL)
inp_freemoptions(inp->inp_moptions);
#endif
- RO_RTFREE(&inp->inp_route);
- if (inp->inp_route.ro_lle)
- LLE_FREE(inp->inp_route.ro_lle); /* zeros ro_lle */
+ RO_INVALIDATE_CACHE(&inp->inp_route);
inp->inp_vflag = 0;
inp->inp_flags2 |= INP_FREED;
@@ -2259,9 +2257,7 @@
in_losing(struct inpcb *inp)
{
- RO_RTFREE(&inp->inp_route);
- if (inp->inp_route.ro_lle)
- LLE_FREE(inp->inp_route.ro_lle); /* zeros ro_lle */
+ RO_INVALIDATE_CACHE(&inp->inp_route);
return;
}
Index: head/sys/netinet/ip_output.c
===================================================================
--- head/sys/netinet/ip_output.c
+++ head/sys/netinet/ip_output.c
@@ -302,11 +302,8 @@
!RT_LINK_IS_UP(rte->rt_ifp) ||
dst->sin_family != AF_INET ||
dst->sin_addr.s_addr != ip->ip_dst.s_addr)) {
- RTFREE(rte);
- rte = ro->ro_rt = (struct rtentry *)NULL;
- if (ro->ro_lle)
- LLE_FREE(ro->ro_lle); /* zeros ro_lle */
- ro->ro_lle = (struct llentry *)NULL;
+ RO_INVALIDATE_CACHE(ro);
+ rte = NULL;
}
ia = NULL;
have_ia_ref = 0;

File Metadata

Mime Type
text/plain
Expires
Fri, Feb 27, 5:07 AM (21 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29015835
Default Alt Text
D13989.id.diff (2 KB)

Event Timeline