[Olsr-cvs] olsrd-current/src/linux kernel_routes.c, 1.18, 1.19 net.c, 1.29, 1.30
Andreas T�nnesen
(spam-protected)
Sat Jan 7 09:16:26 CET 2006
Update of /cvsroot/olsrd/olsrd-current/src/linux
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15798/linux
Modified Files:
kernel_routes.c net.c
Log Message:
Cleanup in use of extern variables. Rather trivial changes, but a lot of them
Index: net.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/linux/net.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** net.c 17 Sep 2005 20:48:50 -0000 1.29
--- net.c 7 Jan 2006 08:16:24 -0000 1.30
***************
*** 822,826 ****
strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
! return (ioctl(ioctl_s, SIOCGIWNAME, &ifr) >= 0) ? 1 : 0;
}
--- 822,826 ----
strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
! return (ioctl(olsr_cnf->ioctl_s, SIOCGIWNAME, &ifr) >= 0) ? 1 : 0;
}
***************
*** 875,879 ****
/* Get bit rate */
! if(ioctl(ioctl_s, SIOCGIWRATE, &ifr) < 0)
{
OLSR_PRINTF(1, "Not able to find rate for WLAN interface %s\n", ifname)
--- 875,879 ----
/* Get bit rate */
! if(ioctl(olsr_cnf->ioctl_s, SIOCGIWRATE, &ifr) < 0)
{
OLSR_PRINTF(1, "Not able to find rate for WLAN interface %s\n", ifname)
***************
*** 898,902 ****
strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
! if (ioctl(ioctl_s, SIOCGMIIPHY, &ifr) < 0) {
if (errno != ENODEV)
OLSR_PRINTF(1, "SIOCGMIIPHY on '%s' failed: %s\n",
--- 898,902 ----
strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
! if (ioctl(olsr_cnf->ioctl_s, SIOCGMIIPHY, &ifr) < 0) {
if (errno != ENODEV)
OLSR_PRINTF(1, "SIOCGMIIPHY on '%s' failed: %s\n",
***************
*** 906,910 ****
mii->reg_num = MII_BMCR;
! if (ioctl(ioctl_s, SIOCGMIIREG, &ifr) < 0) {
OLSR_PRINTF(1, "SIOCGMIIREG on %s failed: %s\n", ifr.ifr_name,
strerror(errno))
--- 906,910 ----
mii->reg_num = MII_BMCR;
! if (ioctl(olsr_cnf->ioctl_s, SIOCGMIIREG, &ifr) < 0) {
OLSR_PRINTF(1, "SIOCGMIIREG on %s failed: %s\n", ifr.ifr_name,
strerror(errno))
***************
*** 948,952 ****
strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
! if (ioctl(ioctl_s, SIOCGMIIPHY, &ifr) < 0) {
if (errno != ENODEV)
OLSR_PRINTF(1, "SIOCGMIIPHY on '%s' failed: %s\n",
--- 948,952 ----
strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
! if (ioctl(olsr_cnf->ioctl_s, SIOCGMIIPHY, &ifr) < 0) {
if (errno != ENODEV)
OLSR_PRINTF(1, "SIOCGMIIPHY on '%s' failed: %s\n",
***************
*** 955,959 ****
}
mii->reg_num = MII_BMSR;
! if (ioctl(ioctl_s, SIOCGMIIREG, &ifr) < 0) {
OLSR_PRINTF(1, "SIOCGMIIREG on %s failed: %s\n", ifr.ifr_name,
strerror(errno))
--- 955,959 ----
}
mii->reg_num = MII_BMSR;
! if (ioctl(olsr_cnf->ioctl_s, SIOCGMIIREG, &ifr) < 0) {
OLSR_PRINTF(1, "SIOCGMIIREG on %s failed: %s\n", ifr.ifr_name,
strerror(errno))
Index: kernel_routes.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/linux/kernel_routes.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** kernel_routes.c 27 Feb 2005 18:39:43 -0000 1.18
--- kernel_routes.c 7 Jan 2006 08:16:24 -0000 1.19
***************
*** 94,107 ****
kernel_route.rt_metric = destination->rt_metric + 1;
! /*
! * Thales Internet GW fix
! */
!
! if((del_gws) &&
(destination->rt_dst.v4 == INADDR_ANY) &&
(destination->rt_dst.v4 == INADDR_ANY))
{
delete_all_inet_gws();
! del_gws = 0;
}
--- 94,103 ----
kernel_route.rt_metric = destination->rt_metric + 1;
! if((olsr_cnf->del_gws) &&
(destination->rt_dst.v4 == INADDR_ANY) &&
(destination->rt_dst.v4 == INADDR_ANY))
{
delete_all_inet_gws();
! olsr_cnf->del_gws = OLSR_FALSE;
}
***************
*** 129,133 ****
//printf("\tiface: %s\n", kernel_route.rt_dev);
! tmp = ioctl(ioctl_s,SIOCADDRT,&kernel_route);
/* kernel_route.rt_dev=*/
--- 125,129 ----
//printf("\tiface: %s\n", kernel_route.rt_dev);
! tmp = ioctl(olsr_cnf->ioctl_s,SIOCADDRT,&kernel_route);
/* kernel_route.rt_dev=*/
***************
*** 178,182 ****
! memset(&zeroaddr, 0, ipsize); /* Use for comparision */
--- 174,178 ----
! memset(&zeroaddr, 0, olsr_cnf->ipsize); /* Use for comparision */
***************
*** 190,194 ****
kernel_route.rtmsg_dst_len = destination->rt_mask.v6;
! if(memcmp(&destination->rt_dst, &destination->rt_router, ipsize) != 0)
{
COPY_IP(&kernel_route.rtmsg_gateway, &destination->rt_router);
--- 186,190 ----
kernel_route.rtmsg_dst_len = destination->rt_mask.v6;
! if(memcmp(&destination->rt_dst, &destination->rt_router, olsr_cnf->ipsize) != 0)
{
COPY_IP(&kernel_route.rtmsg_gateway, &destination->rt_router);
***************
*** 209,217 ****
//OLSR_PRINTF(3, "%s\n", olsr_ip_to_string((union olsr_ip_addr *)&kernel_route.rtmsg_gateway))
! if((tmp = ioctl(ioctl_s, SIOCADDRT, &kernel_route)) >= 0)
{
if(olsr_cnf->open_ipc)
{
! if(memcmp(&destination->rt_router, &null_addr6, ipsize) != 0)
ipc_route_send_rtentry(&destination->rt_dst,
&destination->rt_router,
--- 205,213 ----
//OLSR_PRINTF(3, "%s\n", olsr_ip_to_string((union olsr_ip_addr *)&kernel_route.rtmsg_gateway))
! if((tmp = ioctl(olsr_cnf->ioctl_s, SIOCADDRT, &kernel_route)) >= 0)
{
if(olsr_cnf->open_ipc)
{
! if(memcmp(&destination->rt_router, &null_addr6, olsr_cnf->ipsize) != 0)
ipc_route_send_rtentry(&destination->rt_dst,
&destination->rt_router,
***************
*** 275,279 ****
*/
! tmp = ioctl(ioctl_s, SIOCDELRT, &kernel_route);
--- 271,275 ----
*/
! tmp = ioctl(olsr_cnf->ioctl_s, SIOCDELRT, &kernel_route);
***************
*** 324,330 ****
kernel_route.rtmsg_dst_len = destination->rt_mask.v6;
! memcpy(&kernel_route.rtmsg_dst, &destination->rt_dst, ipsize);
! memcpy(&kernel_route.rtmsg_gateway, &destination->rt_router, ipsize);
kernel_route.rtmsg_flags = destination->rt_flags;
--- 320,326 ----
kernel_route.rtmsg_dst_len = destination->rt_mask.v6;
! memcpy(&kernel_route.rtmsg_dst, &destination->rt_dst, olsr_cnf->ipsize);
! memcpy(&kernel_route.rtmsg_gateway, &destination->rt_router, olsr_cnf->ipsize);
kernel_route.rtmsg_flags = destination->rt_flags;
***************
*** 332,336 ****
! tmp = ioctl(ioctl_s, SIOCDELRT,&kernel_route);
--- 328,332 ----
! tmp = ioctl(olsr_cnf->ioctl_s, SIOCDELRT,&kernel_route);
***************
*** 407,411 ****
((struct sockaddr_in *)&kernel_route.rt_gateway)->sin_family=AF_INET;
! //memcpy(&kernel_route.rt_gateway, gw, ipsize);
--- 403,407 ----
((struct sockaddr_in *)&kernel_route.rt_gateway)->sin_family=AF_INET;
! //memcpy(&kernel_route.rt_gateway, gw, olsr_cnf->ipsize);
More information about the Olsr-cvs
mailing list