[Olsr-dev] A couple of problems with 0.5.2
Ignacio García Pérez
(spam-protected)
Fri Jul 20 16:17:32 CEST 2007
>> A netstat shows that nobody is listening at port 2004 as expected. If I
>> remove the "Accept" parameter everything works fine.
>>
>
> Does the attached patch help?
>
Tested. Yes. I had already spotted the problem and reported it. Hope it
saved you some work...
> Bernd
>
> ------------------------------------------------------------------------
>
> Index: lib/dot_draw/src/olsrd_dot_draw.c
> ===================================================================
> RCS file: /cvsroot/olsrd/olsrd-current/lib/dot_draw/src/olsrd_dot_draw.c,v
> retrieving revision 1.25
> diff -d --unified -r1.25 olsrd_dot_draw.c
> --- lib/dot_draw/src/olsrd_dot_draw.c 15 Jul 2007 19:29:37 -0000 1.25
> +++ lib/dot_draw/src/olsrd_dot_draw.c 20 Jul 2007 12:24:50 -0000
> @@ -270,17 +270,16 @@
> }
> else
> {
> - char *addr = inet_ntoa(pin.sin_addr);
> - if(ntohl(pin.sin_addr.s_addr) != ntohl(ipc_accept_ip.s_addr))
> + if(ntohl(pin.sin_addr.s_addr) != ntohl(ipc_accept_ip.v4))
> {
> - olsr_printf(0, "Front end-connection from foregin host(%s) not allowed!\n", addr);
> + olsr_printf(0, "Front end-connection from foreign host (%s) not allowed!\n", inet_ntoa(pin.sin_addr));
> close(ipc_connection);
> ipc_connection = -1;
> }
> else
> {
> ipc_open = 1;
> - olsr_printf(1, "(DOT DRAW)IPC: Connection from %s\n",addr);
> + olsr_printf(1, "(DOT DRAW)IPC: Connection from %s\n",inet_ntoa(pin.sin_addr));
> pcf_event(1, 1, 1);
> }
> }
> Index: lib/dot_draw/src/olsrd_dot_draw.h
> ===================================================================
> RCS file: /cvsroot/olsrd/olsrd-current/lib/dot_draw/src/olsrd_dot_draw.h,v
> retrieving revision 1.9
> diff -d --unified -r1.9 olsrd_dot_draw.h
> --- lib/dot_draw/src/olsrd_dot_draw.h 15 Jul 2007 19:29:37 -0000 1.9
> +++ lib/dot_draw/src/olsrd_dot_draw.h 20 Jul 2007 12:24:50 -0000
> @@ -50,7 +50,7 @@
> #include "olsrd_plugin.h"
> #include "plugin_util.h"
>
> -extern struct in_addr ipc_accept_ip;
> +extern union olsr_ip_addr ipc_accept_ip;
> extern int ipc_port;
>
> int olsrd_plugin_interface_version(void);
> Index: lib/dot_draw/src/olsrd_plugin.c
> ===================================================================
> RCS file: /cvsroot/olsrd/olsrd-current/lib/dot_draw/src/olsrd_plugin.c,v
> retrieving revision 1.16
> diff -d --unified -r1.16 olsrd_plugin.c
> --- lib/dot_draw/src/olsrd_plugin.c 15 Jul 2007 19:29:37 -0000 1.16
> +++ lib/dot_draw/src/olsrd_plugin.c 20 Jul 2007 12:24:50 -0000
> @@ -60,11 +60,11 @@
> #define MOD_DESC PLUGIN_NAME " " PLUGIN_VERSION " by " PLUGIN_AUTHOR
> #define PLUGIN_INTERFACE_VERSION 5
>
> -struct in_addr ipc_accept_ip;
> +union olsr_ip_addr ipc_accept_ip;
> int ipc_port;
>
> -static void my_init(void) __attribute__ ((constructor)) ;
> -static void my_fini(void) __attribute__ ((destructor));
> +static void my_init(void) __attribute__((constructor));
> +static void my_fini(void) __attribute__((destructor));
>
>
> /**
> @@ -77,7 +77,7 @@
>
> /* defaults for parameters */
> ipc_port = 2004;
> - ipc_accept_ip.s_addr = htonl(INADDR_LOOPBACK);
> + ipc_accept_ip.v4 = htonl(INADDR_LOOPBACK);
> }
>
>
>
More information about the Olsr-dev
mailing list