PERFORCE change 126490 for review
Kip Macy
kmacy at FreeBSD.org
Sun Sep 16 15:00:56 PDT 2007
http://perforce.freebsd.org/chv.cgi?CH=126490
Change 126490 by kmacy at kmacy_home:ethng on 2007/09/16 22:00:39
cache the route in the inpcb
this is currently half-complete at best as it doesn't yet
re-validate the rt_entry against a gen_count as is intended
Affected files ...
.. //depot/projects/ethng/src/sys/netinet/udp_usrreq.c#4 edit
Differences ...
==== //depot/projects/ethng/src/sys/netinet/udp_usrreq.c#4 (text+ko) ====
@@ -967,8 +967,23 @@
if (unlock_udbinfo)
INP_INFO_WUNLOCK(&udbinfo);
+
+ /*
+ * XXX need to validate
+ */
+ if (inp->inp_route.ro_rt == NULL) {
+ struct sockaddr_in *dst = (struct sockaddr_in *)&inp->inp_route.ro_dst;
+ struct ip *ip = mtod(m, struct ip *);
+
+ bzero(dst, sizeof(*dst));
+ dst->sin_family = AF_INET;
+ dst->sin_len = sizeof(*dst);
+ dst->sin_addr = ip->ip_dst;
+
+ rtalloc_ign(&inp->inp_route, 0);
+ }
m->m_pkthdr.rss_hash = inp->inp_rss_hash;
- error = ip_output(m, inp->inp_options, NULL, ipflags,
+ error = ip_output(m, inp->inp_options, &inp->inp_route, ipflags,
inp->inp_moptions, inp);
INP_UNLOCK(inp);
return (error);
More information about the p4-projects
mailing list