[Olsr-cvs] olsrd-current/src/bsd kernel_routes.c,1.12,1.13

Bernd Petrovitsch (spam-protected)
Wed Sep 5 18:17:38 CEST 2007


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

Modified Files:
	kernel_routes.c 
Log Message:
* applied 102-olsrd-rt-refactoring-fixes.patch from Sven-Ola Tuecke <(spam-protected)>

Index: kernel_routes.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/bsd/kernel_routes.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** kernel_routes.c	5 Sep 2007 16:11:11 -0000	1.12
--- kernel_routes.c	5 Sep 2007 16:17:36 -0000	1.13
***************
*** 129,138 ****
      for (awalker = addrs; awalker != NULL; awalker = awalker->ifa_next)
        if (awalker->ifa_addr->sa_family == AF_LINK &&
!           strcmp(awalker->ifa_name, nexthop->iface->int_name) == 0)
          break;
  
      if (awalker == NULL)
      {
!       fprintf(stderr, "interface %s not found\n", nexthop->iface->int_name);
        freeifaddrs(addrs);
        return -1;
--- 129,138 ----
      for (awalker = addrs; awalker != NULL; awalker = awalker->ifa_next)
        if (awalker->ifa_addr->sa_family == AF_LINK &&
!           strcmp(awalker->ifa_name, if_ifwithindex_name(nexthop->iif_index)) == 0)
          break;
  
      if (awalker == NULL)
      {
!       fprintf(stderr, "interface %s not found\n", if_ifwithindex_name(nexthop->iif_index));
        freeifaddrs(addrs);
        return -1;
***************
*** 232,236 ****
    else
    {
!     memcpy(&sin6.sin6_addr.s6_addr, &nexthop->iface->int6_addr.sin6_addr.s6_addr,
        sizeof(struct in6_addr));
  
--- 232,243 ----
    else
    {
!     // Sven-Ola: This looks really ugly (please compar to IPv4 above)
!     struct interface* iface = if_ifwithindex(nexthop->iif_index);
!     if (NULL == iface)
!     {
!       fprintf(stderr, "interface %s not found\n", if_ifwithindex_name(nexthop->iif_index));
!       return -1;
!     }
!     memcpy(&sin6.sin6_addr.s6_addr, &iface->int6_addr.sin6_addr.s6_addr,
        sizeof(struct in6_addr));
  
***************
*** 250,255 ****
    if ((rtm->rtm_flags & RTF_GATEWAY) != 0)
    {
!     strcpy(&sdl.sdl_data[0], nexthop->iface->int_name);
!     sdl.sdl_nlen = (u_char)strlen(nexthop->iface->int_name);
      memcpy(walker, &sdl, sizeof (sdl));
      walker += step_dl;
--- 257,262 ----
    if ((rtm->rtm_flags & RTF_GATEWAY) != 0)
    {
!     strcpy(&sdl.sdl_data[0], if_ifwithindex_name(nexthop->iif_index));
!     sdl.sdl_nlen = (u_char)strlen((char*)&sdl.sdl_data[0]);
      memcpy(walker, &sdl, sizeof (sdl));
      walker += step_dl;





More information about the Olsr-cvs mailing list