[Olsr-cvs] olsrd-current/src ipc_frontend.c, 1.42, 1.43 main.c, 1.106, 1.107 olsr_cfg.h, 1.41, 1.42
Bernd Petrovitsch
(spam-protected)
Thu Nov 29 23:21:28 CET 2007
Update of /cvsroot/olsrd/olsrd-current/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7724/src
Modified Files:
ipc_frontend.c main.c olsr_cfg.h
Log Message:
"open_ipc" is only a boolean value containing "olsr_cnf->debug_level > 1".
So I see no reason to keep that variable.
Apart from the the attached patch makes the "#if" condition for the
"rts" field identical to all other references to it.
Index: olsr_cfg.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_cfg.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** olsr_cfg.h 29 Nov 2007 15:47:26 -0000 1.41
--- olsr_cfg.h 29 Nov 2007 22:21:26 -0000 1.42
***************
*** 193,197 ****
olsr_bool willingness_auto;
int ipc_connections;
- olsr_bool open_ipc;
olsr_bool use_hysteresis;
struct hyst_param hysteresis_param;
--- 193,196 ----
***************
*** 225,229 ****
#if LINUX_POLICY_ROUTING
int rtnl_s; /* Socket used for rtnetlink messages */
! #else
int rts; /* Socket used for route changes on BSDs */
#endif
--- 224,230 ----
#if LINUX_POLICY_ROUTING
int rtnl_s; /* Socket used for rtnetlink messages */
! #endif
!
! #if defined __FreeBSD__ || defined __MacOSX__ || defined __NetBSD__ || defined __OpenBSD__
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.106
retrieving revision 1.107
diff -C2 -d -r1.106 -r1.107
*** main.c 29 Nov 2007 00:49:38 -0000 1.106
--- main.c 29 Nov 2007 22:21:26 -0000 1.107
***************
*** 266,272 ****
* Print configuration
*/
! if(olsr_cnf->debug_level > 1)
olsrd_print_cnf(olsr_cnf);
!
#ifndef WIN32
/* Disable redirects globally */
--- 266,272 ----
* Print configuration
*/
! if(olsr_cnf->debug_level > 1) {
olsrd_print_cnf(olsr_cnf);
! }
#ifndef WIN32
/* Disable redirects globally */
***************
*** 277,302 ****
*socket for icotl calls
*/
! if ((olsr_cnf->ioctl_s = socket(olsr_cnf->ip_version, SOCK_DGRAM, 0)) < 0)
!
! {
! olsr_syslog(OLSR_LOG_ERR, "ioctl socket: %m");
! olsr_exit(__func__, 0);
! }
#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)
! {
! olsr_syslog(OLSR_LOG_ERR, "routing socket: %m");
! olsr_exit(__func__, 0);
! }
#endif
--- 277,301 ----
*socket for icotl calls
*/
! olsr_cnf->ioctl_s = socket(olsr_cnf->ip_version, SOCK_DGRAM, 0);
! if (olsr_cnf->ioctl_s < 0) {
! olsr_syslog(OLSR_LOG_ERR, "ioctl socket: %m");
! olsr_exit(__func__, 0);
! }
#if LINUX_POLICY_ROUTING
! olsr_cnf->rtnl_s = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);
! if (olsr_cnf->rtnl_s < 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__
! olsr_cnf->rts = socket(PF_ROUTE, SOCK_RAW, 0);
! if (olsr_cnf->rts < 0) {
! olsr_syslog(OLSR_LOG_ERR, "routing socket: %m");
! olsr_exit(__func__, 0);
! }
#endif
***************
*** 373,379 ****
/* Initialize the IPC socket */
! if(olsr_cnf->open_ipc)
ipc_init();
!
/* Initialisation of different tables to be used.*/
olsr_init_tables();
--- 372,378 ----
/* Initialize the IPC socket */
! if (olsr_cnf->ipc_connections > 0) {
ipc_init();
! }
/* Initialisation of different tables to be used.*/
olsr_init_tables();
***************
*** 486,491 ****
/* front-end IPC socket */
! if(olsr_cnf->open_ipc)
shutdown_ipc();
/* OLSR sockets */
--- 485,491 ----
/* front-end IPC socket */
! if (olsr_cnf->ipc_connections > 0) {
shutdown_ipc();
+ }
/* OLSR sockets */
***************
*** 797,801 ****
{
cnf->ipc_connections = 1;
- cnf->open_ipc = OLSR_TRUE;
continue;
}
--- 797,800 ----
Index: ipc_frontend.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/ipc_frontend.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** ipc_frontend.c 29 Nov 2007 18:10:12 -0000 1.42
--- ipc_frontend.c 29 Nov 2007 22:21:26 -0000 1.43
***************
*** 271,275 ****
char *tmp;
! if (!olsr_cnf->open_ipc) {
return -1;
}
--- 271,275 ----
char *tmp;
! if (olsr_cnf->ipc_connections <= 0) {
return -1;
}
More information about the Olsr-cvs
mailing list