[patch] kernel protocol learn on FreeBSD 7

Eugene Perevyazko john at dnepro.net
Mon Nov 9 18:27:06 CET 2009


Hello bird-users readers!

I'm trying to use bird on PPP access-server running FreeBSD 7.

The first problem I've met was bird not learning routes that are added and
removed by ppp daemon based on Radius user-data.

I've made a simple patch but not sure if it is full and correct.
Can anyone review it? Especially I'm not sure what should be marked as 
KRT_SRC_REDIRECT and what are the consequences of not using this value.

--- sysdep/bsd/krt-sock.c.old	2009-11-09 17:42:47.000000000 +0200
+++ sysdep/bsd/krt-sock.c	2009-11-09 17:48:58.000000000 +0200
@@ -269,6 +269,8 @@
   int src;
   int flags = msg->rtm.rtm_flags;
   int addrs = msg->rtm.rtm_addrs;
+  pid_t sender_pid = msg->rtm.rtm_pid;
+  pid_t my_pid;
   int masklen = -1;
 
   if (!(flags & RTF_UP))
@@ -375,6 +377,12 @@
   }
 
   src = KRT_SRC_UNKNOWN;	/* FIXME */
+  src = KRT_SRC_ALIEN;
+  my_pid = getpid();
+  if (sender_pid == my_pid)
+  {
+    src = KRT_SRC_BIRD;
+  }
 
   e = rte_get_temp(&a);
   e->net = net;

+++ sysdep/cf/bsd.h.old	2009-11-09 18:06:53.000000000 +0200
--- sysdep/cf/bsd.h	2009-11-09 17:38:21.000000000 +0200
@@ -7,7 +7,7 @@
  */
 
 #define CONFIG_AUTO_ROUTES
-#undef CONFIG_SELF_CONSCIOUS
+#define CONFIG_SELF_CONSCIOUS
 #undef CONFIG_MULTIPLE_TABLES
 
 #undef CONFIG_UNIX_IFACE

-- 
Eugene Perevyazko




More information about the Bird-users mailing list