[Olsr-cvs] olsrd-current/src/bsd net.c,1.31,1.32

Bernd Petrovitsch (spam-protected)
Wed Mar 14 15:01:16 CET 2007


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

Modified Files:
	net.c 
Log Message:
* applied osx-ip6.patch made by Grégoire Henry <(spam-protected)>, posted on 2007-03-12

Index: net.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/bsd/net.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** net.c	14 Feb 2007 13:03:13 -0000	1.31
--- net.c	14 Mar 2007 14:01:13 -0000	1.32
***************
*** 74,77 ****
--- 74,84 ----
  #endif
  
+ #ifdef __MacOSX__
+ #include <ifaddrs.h>
+ #include <net/if_var.h>
+ #include <net/ethernet.h>
+ #include <netinet/in_var.h>
+ #endif
+ 
  #include <net/if_dl.h>
  #ifdef SPOOF
***************
*** 91,95 ****
--- 98,106 ----
  {
    int old;
+ #if __MacOSX__
+   size_t len = sizeof (old);
+ #else
    unsigned int len = sizeof (old);
+ #endif
  
  #ifdef __OpenBSD__
***************
*** 175,179 ****
  
    ignore_redir = set_sysctl_int(name, 0);
! #elif defined __FreeBSD__
    if (olsr_cnf->ip_version == AF_INET)
    {
--- 186,190 ----
  
    ignore_redir = set_sysctl_int(name, 0);
! #elif defined __FreeBSD__ || defined __MacOSX__
    if (olsr_cnf->ip_version == AF_INET)
    {
***************
*** 257,261 ****
      name = "net.inet6.icmp6.rediraccept";
  
! #elif defined __FreeBSD__
    if (olsr_cnf->ip_version == AF_INET)
      name = "net.inet.icmp.drop_redirect";
--- 268,272 ----
      name = "net.inet6.icmp6.rediraccept";
  
! #elif defined __FreeBSD__ || defined __MacOSX__
    if (olsr_cnf->ip_version == AF_INET)
      name = "net.inet.icmp.drop_redirect";
***************
*** 436,439 ****
--- 447,451 ----
      }
  
+ #ifdef IPV6_RECVPKTINFO
    if (setsockopt(sock, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on)) < 0)
      {
***************
*** 441,444 ****
--- 453,463 ----
        return (-1);
      }
+ #elif defined IPV6_PKTINFO
+     if (setsockopt(sock, IPPROTO_IPV6, IPV6_PKTINFO, &on, sizeof(on)) < 0)
+       {
+ 	perror("IPV6_PKTINFO failed");
+ 	return (-1);
+       }
+ #endif
  
    if (bind(sock, (struct sockaddr *)sin, sizeof (*sin)) < 0) 





More information about the Olsr-cvs mailing list