[Olsr-cvs] olsrd-current/src main.c, 1.97, 1.98 olsr_cfg.h, 1.32, 1.33

Bernd Petrovitsch (spam-protected)
Thu Sep 13 18:08:15 CEST 2007


Update of /cvsroot/olsrd/olsrd-current/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv632/src

Modified Files:
	main.c olsr_cfg.h 
Log Message:
* added 104-olsrd-policy-routing.patch by Sven-Ola Tücke <(spam-protected)> (with trivial changes)

Index: olsr_cfg.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_cfg.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** olsr_cfg.h	6 Sep 2007 12:08:28 -0000	1.32
--- olsr_cfg.h	13 Sep 2007 16:08:13 -0000	1.33
***************
*** 46,49 ****
--- 46,55 ----
  #include "olsr_types.h"
  
+ #if defined linux
+ #  define LINUX_POLICY_ROUTING 1
+ #else
+ #  define LINUX_POLICY_ROUTING 0
+ #endif
+ 
  /* Default values not declared in olsr_protocol.h */
  #define DEF_POLLRATE        0.05
***************
*** 201,204 ****
--- 207,211 ----
    olsr_bool                allow_no_interfaces;
    olsr_u16_t               tos;
+   olsr_u8_t                rttable;
    olsr_bool                willingness_auto;
    olsr_u8_t                willingness;
***************
*** 235,239 ****
--- 242,250 ----
  
    int                      ioctl_s;              /* Socket used for ioctl calls */
+ #if LINUX_POLICY_ROUTING
+   int                      rtnl_s;               /* Socket used for rtnetlink messages */
+ #else
    int                      rts;                  /* Socket used for route changes on BSDs */
+ #endif
  };
  

Index: main.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/main.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -C2 -d -r1.97 -r1.98
*** main.c	5 Sep 2007 16:11:10 -0000	1.97
--- main.c	13 Sep 2007 16:08:13 -0000	1.98
***************
*** 56,59 ****
--- 56,65 ----
  #include "build_msg.h"
  
+ #if LINUX_POLICY_ROUTING
+ #include <linux/types.h>
+ #include <linux/rtnetlink.h>
+ #include <fcntl.h>
+ #endif
+ 
  /* Global stuff externed in defs.h */
  FILE *debug_handle;             /* Where to send debug(defaults to stdout) */
***************
*** 266,269 ****
--- 272,284 ----
      }
  
+ #if LINUX_POLICY_ROUTING
+   if ((olsr_cnf->rtnl_s = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE)) < 0) 
+     {
+       olsr_syslog(OLSR_LOG_ERR, "rtnetlink socket: %m");
+       olsr_exit(__func__, 0);
+     }
+   fcntl(olsr_cnf->rtnl_s, F_SETFL, O_NONBLOCK);
+ #endif
+ 
  #if defined __FreeBSD__ || defined __MacOSX__ || defined __NetBSD__ || defined __OpenBSD__
    if ((olsr_cnf->rts = socket(PF_ROUTE, SOCK_RAW, 0)) < 0)
***************
*** 488,491 ****
--- 503,510 ----
    close(olsr_cnf->ioctl_s);
  
+ #if LINUX_POLICY_ROUTING
+   close(olsr_cnf->rtnl_s);
+ #endif
+ 
  #if defined __FreeBSD__ || defined __MacOSX__ || defined __NetBSD__ || defined __OpenBSD__
    /* routing socket */





More information about the Olsr-cvs mailing list