PERFORCE change 150822 for review

Ryan French rfrench at FreeBSD.org
Thu Oct 2 23:44:53 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=150822

Change 150822 by rfrench at rfrench_mpls on 2008/10/02 23:44:34

	Made a few more changes to the psuedo routing entry creater. Managed to stop the kernel from page faulting when an MPLS packet is received, but the interface is now saying it cannot handle to af type. I will be hopefully getting this working by the end of the day.	

Affected files ...

.. //depot/projects/soc2008/rfrench_mpls/netmpls/mpls_input.c#11 edit

Differences ...

==== //depot/projects/soc2008/rfrench_mpls/netmpls/mpls_input.c#11 (text+ko) ====

@@ -159,13 +159,13 @@
 #ifdef MPLS_DEBUG
                 printf("smpls af %d len %d in_label %d in_ifindex %d\n",
                     smpls->smpls_family, smpls->smpls_len,
-                    MPLS_LABEL_GET(smpls->smpls_in_label),
+		    MPLS_LABEL_GET(smpls->smpls_in_label),
                     smpls->smpls_in_ifindex);
 #endif
-
-                rt = rtalloc1(smplstosa(smpls),1, 0);
+/* uncomment below once routing is implemented */
+		//rt = rtalloc1(smplstosa(smpls),1, 0);
                 
-//Uncoment this section when routing has been setup
+//Uncomment this section when routing has been setup
 //                 if (rt == NULL) {
 //                         /* no entry for this label */
 // #ifdef MPLS_DEBUG
@@ -174,12 +174,12 @@
 //                         m_freem(m);
 //                         goto done;
 //                 }
-
-                rt->rt_use++;
-                smpls = satosmpls(rt_key(rt));
+//
+//                rt->rt_use++;
+//                smpls = satosmpls(rt_key(rt));
                 
 #ifdef MPLS_DEBUG /* Remove this once routing has been setup */
-				create_fake_entry(smpls);
+		create_fake_entry(smpls);
 #endif
 
 #ifdef MPLS_DEBUG
@@ -219,13 +219,15 @@
 
                 /* refetch label */
                 shim = mtod(m, struct shim_hdr *);
-                ifp = rt->rt_ifp;
+
+        /* Remove once routing is implemented */     
+	//	ifp = rt->rt_ifp;
 
                 if (smpls->smpls_out_ifindex)
                         break;
-
-                RTFREE(rt);
-                rt = NULL;
+/* Remove comments when routing has been implemented */
+//                RTFREE(rt);
+//                rt = NULL;
         }
 
         /* write back TTL */
@@ -239,7 +241,8 @@
 #endif
 
         (*ifp->if_output)(ifp, m, smplstosa(smpls), rt);
+
 done:
-        if (rt)
-                RTFREE(rt);
+	   if (rt)
+     	          RTFREE(rt);
 }


More information about the p4-projects mailing list