From 7f6794adf7e261a28b0166ee9c0faca2ee9acf64 Mon Sep 17 00:00:00 2001
From: Shashi Guruprasad <shash@flux.utah.edu>
Date: Wed, 10 Dec 2003 02:31:05 +0000
Subject: [PATCH] Changed os_ifconfig_line() to attach an rtabid if present.

---
 tmcd/freebsd/liblocsetup.pm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tmcd/freebsd/liblocsetup.pm b/tmcd/freebsd/liblocsetup.pm
index ef1efb0e4c..f0547b5b26 100644
--- a/tmcd/freebsd/liblocsetup.pm
+++ b/tmcd/freebsd/liblocsetup.pm
@@ -157,7 +157,17 @@ sub os_ifconfig_line($$$$$$;$)
 	$mediaopt = $IFC_FDUPLEX;
     }
 
-    $uplines   = sprintf($IFCONFIG, $iface, $inet, $mask, $media, $mediaopt);
+    $uplines = "";
+    
+    #
+    # Must set route table id before assigning IP address so that interface
+    # route winds up in the correct table.
+    #
+    if (defined($rtabid)) {
+	$uplines .= "$IFCONFIGBIN $iface rtabid $rtabid\n    ";
+    }
+
+    $uplines   .= sprintf($IFCONFIG, $iface, $inet, $mask, $media, $mediaopt);
     $downlines = "$IFCONFIGBIN $iface down\n";
 
     if ($aliases ne "") {
-- 
GitLab