Author: karels
Date: Wed Sep 21 00:06:49 2016
New Revision: 306060
URL: https://svnweb.freebsd.org/changeset/base/306060

Log:
  MFC r304713:
  
    Fix L2 caching for UDP over IPv6
  
    ip6_output() was missing cache invalidation code analougous to
    ip_output.c. r304545 disabled L2 caching for UDP/IPv6 as a workaround.
    This change adds the missing cache invalidation code and reverts
    r304545.
  
    Reviewed by:    gnn
    Approved by:    gnn (mentor)
    Tested by:      peter@, Mike Andrews
    Differential Revision:  https://reviews.freebsd.org/D7591

Modified:
  stable/11/sys/netinet6/ip6_output.c
  stable/11/sys/netinet6/udp6_usrreq.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet6/ip6_output.c
==============================================================================
--- stable/11/sys/netinet6/ip6_output.c Tue Sep 20 23:16:36 2016        
(r306059)
+++ stable/11/sys/netinet6/ip6_output.c Wed Sep 21 00:06:49 2016        
(r306060)
@@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$");
 
 #include <net/if.h>
 #include <net/if_var.h>
+#include <net/if_llatbl.h>
 #include <net/netisr.h>
 #include <net/route.h>
 #include <net/pfil.h>
@@ -552,6 +553,9 @@ again:
                rt = ro->ro_rt;
                ifp = ro->ro_rt->rt_ifp;
        } else {
+               if (ro->ro_lle)
+                       LLE_FREE(ro->ro_lle);   /* zeros ro_lle */
+               ro->ro_lle = NULL;
                if (fwd_tag == NULL) {
                        bzero(&dst_sa, sizeof(dst_sa));
                        dst_sa.sin6_family = AF_INET6;
@@ -821,6 +825,9 @@ again:
                } else {
                        RO_RTFREE(ro);
                        needfiblookup = 1; /* Redo the routing table lookup. */
+                       if (ro->ro_lle)
+                               LLE_FREE(ro->ro_lle);   /* zeros ro_lle */
+                       ro->ro_lle = NULL;
                }
        }
        /* See if fib was changed by packet filter. */
@@ -829,6 +836,9 @@ again:
                fibnum = M_GETFIB(m);
                RO_RTFREE(ro);
                needfiblookup = 1;
+               if (ro->ro_lle)
+                       LLE_FREE(ro->ro_lle);   /* zeros ro_lle */
+               ro->ro_lle = NULL;
        }
        if (needfiblookup)
                goto again;

Modified: stable/11/sys/netinet6/udp6_usrreq.c
==============================================================================
--- stable/11/sys/netinet6/udp6_usrreq.c        Tue Sep 20 23:16:36 2016        
(r306059)
+++ stable/11/sys/netinet6/udp6_usrreq.c        Wed Sep 21 00:06:49 2016        
(r306060)
@@ -898,7 +898,7 @@ udp6_output(struct inpcb *inp, struct mb
 
                UDP_PROBE(send, NULL, inp, ip6, inp, udp6);
                UDPSTAT_INC(udps_opackets);
-               error = ip6_output(m, optp, NULL, flags,
+               error = ip6_output(m, optp, &inp->inp_route6, flags,
                    inp->in6p_moptions, NULL, inp);
                break;
        case AF_INET:
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to