Small fixes to allow correct compilation under FreeBSD (tested with 4.3)
[tinc] / src / route.c
index c93379b..1b6336d 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: route.c,v 1.1.2.7 2001/03/04 13:59:32 guus Exp $
+    $Id: route.c,v 1.1.2.9 2001/05/28 08:21:43 guus Exp $
 */
 
 #include "config.h"
 
-#include <netinet/in.h>
+#ifdef HAVE_FREEBSD
+ #include <sys/param.h>
+#else
+ #include <netinet/in.h>
+#endif
 #include <utils.h>
 #include <xalloc.h>
 #include <syslog.h>
@@ -181,11 +185,12 @@ void route_incoming(connection_t *source, vpn_packet_t *packet)
 {
   switch(routing_mode)
     {
+      case RMODE_ROUTER:
+        memcpy(packet->data, mymac.net.mac.address.x, 6);
+        break;
       case RMODE_SWITCH:
         learn_mac(source, (mac_t *)(&packet->data[0]));
         break;
-      case RMODE_ROUTER:
-        memcpy(packet->data, mymac.net.mac.address.x, 6);
     }
   
   accept_packet(packet);