[Olsr-cvs] olsrd-current/src net_olsr.h, 1.16, 1.17 net_olsr.c, 1.34, 1.35

Bernd Petrovitsch (spam-protected)
Sun Nov 18 21:01:10 CET 2007


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

Modified Files:
	net_olsr.h net_olsr.c 
Log Message:
consolidated ip{4,6,}{cmp,equal}: all are nwo inline functions using only
the minimal necessary operations. Thanks to Hannes Gredler
<(spam-protected)> and Sven-Ola Tuecke <(spam-protected)> for pointing
that out and suggesting the `inline`, respectively.


Index: net_olsr.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** net_olsr.c	17 Nov 2007 00:05:54 -0000	1.34
--- net_olsr.c	18 Nov 2007 20:01:08 -0000	1.35
***************
*** 646,657 ****
  }
  
- 
- int ipcmp(const union olsr_ip_addr * const a, const union olsr_ip_addr * const b)
- {
-     return  olsr_cnf->ip_version == AF_INET
-         ? ip4cmp(&a->v4, &b->v4)
-         : ip6cmp(&a->v6, &b->v6);
- }
- 
  /*
   * Local Variables:
--- 646,649 ----

Index: net_olsr.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** net_olsr.h	11 Nov 2007 22:51:54 -0000	1.16
--- net_olsr.h	18 Nov 2007 20:01:08 -0000	1.17
***************
*** 67,72 ****
  static INLINE int ip6equal(const struct in6_addr *a, const struct in6_addr *b) { return ip6cmp(a, b) == 0; }
  
! int ipcmp(const union olsr_ip_addr *a, const union olsr_ip_addr *b);
! static INLINE int ipequal(const union olsr_ip_addr *a, const union olsr_ip_addr *b) { return ipcmp(a, b) == 0; }
  
  /* Do not use this - this is as evil as the COPY_IP() macro was and only used in
--- 67,74 ----
  static INLINE int ip6equal(const struct in6_addr *a, const struct in6_addr *b) { return ip6cmp(a, b) == 0; }
  
! #if 0
! static INLINE int ipcmp(const union olsr_ip_addr *a, const union olsr_ip_addr *b) { return olsr_cnf->ip_version == AF_INET ? ip4cmp(&a->v4, &b->v4) : ip6cmp(&a->v6, &b->v6); }
! #endif
! static INLINE int ipequal(const union olsr_ip_addr *a, const union olsr_ip_addr *b) { return olsr_cnf->ip_version == AF_INET ? ip4equal(&a->v4, &b->v4) : ip6equal(&a->v6, &b->v6); }
  
  /* Do not use this - this is as evil as the COPY_IP() macro was and only used in





More information about the Olsr-cvs mailing list