Committer: Miika Komu <miika@xxxxxx> Date: 19/03/2010 at 11:31:41 Revision: 3801 Revision-id: miika@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Branch nick: release-1.0.5 Log: Syncronized to trunk revisions 3822..3832 Modified: M Makefile.am M autogen.sh M configure.ac M firewall/sava_api.c M lib/core/message.c M lib/core/misc.c M lib/core/misc.h M lib/performance/performance.c M release.version === modified file 'Makefile.am' --- Makefile.am 2010-03-19 09:20:44 +0000 +++ Makefile.am 2010-03-19 09:32:05 +0000 @@ -708,4 +708,4 @@ rm -f aclocal.m4 compile config.* configure depcomp install-sh rm -f ltmain.sh m4/*.m4 Makefile.in missing py-compile -.PHONY: bin doxygen increl olddeb syncrepo +.PHONY: bin deb doxygen increl olddeb rpm syncrepo === modified file 'autogen.sh' --- autogen.sh 2010-03-03 13:16:18 +0000 +++ autogen.sh 2010-03-19 09:32:05 +0000 @@ -60,9 +60,9 @@ autoreconf --install --force || \ (echo "Missing libtool, automake, autoconf or autoreconf?" && exit 1) (echo "" && echo "HIPL has the following dependencies: " && display_dependencies && exit 1) - # bug fix for "make dist" problems on a clean check out - touch tools/hipdnsproxy tools/hipdnskeyparse - chmod a-x tools/hipdnsproxy tools/hipdnskeyparse + # Clean up generated scripts for "make bin". Otherwise we get + # /usr/local/lib/python2.6/dist-packages/ as the path in the scripts. + rm -f tools/hipdnsproxy tools/hipdnskeyparse } help() { === modified file 'configure.ac' --- configure.ac 2010-03-03 13:16:18 +0000 +++ configure.ac 2010-03-19 09:32:05 +0000 @@ -175,18 +175,6 @@ AH_TEMPLATE(CONFIG_HIP_RVS, [Defined to 1 if RVS is enabled.]) fi -AC_ARG_ENABLE(ice, - AC_HELP_STRING([--enable-ice], - [ICE-based HIP NAT traversal extensions (default is YES)]), - [ac_cv_use_ice=$enableval], [ac_cv_use_ice=yes]) -AC_CACHE_CHECK([whether to use ICE], - [ac_cv_use_ice], [ac_cv_use_ice=yes]) -if test x"$ac_cv_use_ice" = x"yes"; then - AC_DEFINE(CONFIG_HIP_ICE) - AH_TEMPLATE(CONFIG_HIP_ICE, [Defined to 1 if ICE is enabled.]) -fi -AM_CONDITIONAL(HIP_ICE, test x"$ac_cv_use_ice" = x"yes") - AC_ARG_ENABLE(hipproxy, AC_HELP_STRING([--enable-hipproxy], [HIP Proxy (default is YES)]), === modified file 'firewall/sava_api.c' --- firewall/sava_api.c 2010-03-03 13:16:18 +0000 +++ firewall/sava_api.c 2010-03-19 09:32:05 +0000 @@ -413,8 +413,8 @@ return err; } -static -struct sava_ip_option *__hip_sava_build_enc_addr_ipv4_option(struct in6_addr *enc_addr) +#ifdef CONFIG_SAVAH_IP_OPTION +static struct sava_ip_option *__hip_sava_build_enc_addr_ipv4_option(struct in6_addr *enc_addr) { HIP_ASSERT(enc_addr != NULL); @@ -431,10 +431,10 @@ return opt; } -#if 0 -static -struct in6_addr *__map_enc_ip_addr_to_network_order(struct in6_addr *enc_addr, - int ip_version) +#else + +static struct in6_addr *__map_enc_ip_addr_to_network_order(struct in6_addr *enc_addr, + int ip_version) { struct in6_addr *no_addr = (struct in6_addr *) malloc(sizeof(struct in6_addr)); @@ -456,10 +456,9 @@ return no_addr; } -#endif +#endif // CONFIG_SAVAH_IP_OPTION -static -int __hip_sava_conn_db_init() +static int __hip_sava_conn_db_init() { int err = 0; HIP_IFEL(!(sava_conn_db = hip_ht_init(LHASH_HASH_FN(__hip_sava_conn_entry), @@ -990,12 +989,17 @@ struct sockaddr_in *dst4 = (struct sockaddr_in *) &dst; struct sockaddr_in6 *dst6 = (struct sockaddr_in6 *) &dst; struct sava_ip_option *opt = NULL; +#ifdef CONFIG_SAVAH_IP_OPTION struct sava_tlv_padding *sava_ip6_padding = NULL; struct sava_tlv_option *sava_ip6_opt = NULL; struct ip6_hbh *ip6hbh_hdr = NULL; + char *buff_ip_opt = NULL; +#else + struct tcphdr *tcp = NULL; + struct udphdr *udp = NULL; +#endif int verdict = DROP; int err = 0, sent = 0; - char *buff_ip_opt = NULL; int protocol = 0; int ip_raw_sock = 0; int on = 1, off = 0; @@ -1294,7 +1298,6 @@ { int verdict = 0, auth_len = 0, sent = 0; struct in6_addr *enc_addr = NULL; - struct in6_addr *opt_addr = NULL; hip_sava_enc_ip_entry_t *enc_entry = NULL; struct sockaddr_storage dst; struct sockaddr_in *dst4 = (struct sockaddr_in *) &dst; @@ -1302,16 +1305,23 @@ int dst_len = 0; struct ip6_hdr *ip6hdr = NULL; struct ip *iphdr = NULL; - struct ip6_hbh *ip6hbh_hdr = NULL; char *buff = (char *) ctx->ipq_packet->payload; int buff_len = ctx->ipq_packet->data_len; int protocol = 0; int ip_raw_sock = 0; int on = 1, off = 0; +#ifdef CONFIG_SAVAH_IP_OPTION + struct in6_addr *opt_addr = NULL; + struct ip6_hbh *ip6hbh_hdr = NULL; int hdr_offset = 0; int hdr_len = 0; char *buff_no_opt = NULL; struct sava_ip_option *opt = NULL; +#else + struct tcphdr *tcp = NULL; + struct udphdr *udp = NULL; + struct in6_addr *enc_addr_no = NULL; +#endif memset(&dst, 0, sizeof(struct sockaddr_storage)); @@ -1592,6 +1602,9 @@ hip_sava_peer_info_t *info_entry = NULL; hip_sava_enc_ip_entry_t *enc_entry = NULL; int err = 0; +#ifndef CONFIG_SAVAH_IP_OPTION + struct in6_addr *enc_addr_no = NULL; +#endif HIP_DEBUG_HIT("SRC: ", src); HIP_DEBUG_HIT("HIT: ", hitr); === modified file 'lib/core/message.c' --- lib/core/message.c 2010-03-03 13:16:18 +0000 +++ lib/core/message.c 2010-03-19 09:32:05 +0000 @@ -572,9 +572,6 @@ HIP_DEBUG("hip_read_control_msg_all() invoked.\n"); - HIP_IFEL(((len = hip_peek_recv_total_len(socket, encap_hdr_size, HIP_DEFAULT_MSG_TIMEOUT)) <= 0), - -1, "Bad packet length (%d)\n", len); - memset(msg_info, 0, sizeof(hip_portpair_t)); memset(&msg, 0, sizeof(msg)); memset(cbuff, 0, sizeof(cbuff)); @@ -591,7 +588,7 @@ msg.msg_controllen = sizeof(cbuff); msg.msg_flags = 0; - iov.iov_len = len; + iov.iov_len = HIP_MAX_NETWORK_PACKET; iov.iov_base = hip_msg; pktinfo.pktinfo_in4 = NULL; === modified file 'lib/core/misc.c' --- lib/core/misc.c 2010-03-19 09:24:10 +0000 +++ lib/core/misc.c 2010-03-19 09:32:05 +0000 @@ -488,8 +488,17 @@ } #ifndef __KERNEL__ -uint16_t ipv4_checksum(uint8_t protocol, uint8_t src[], uint8_t dst[], uint8_t data[], uint16_t len) +/** + * Generate the IPv4 header checksum + * @param s source address + * @param d destination address + * @param c data + */ +uint16_t ipv4_checksum(uint8_t protocol, void *s, void *d, void *c, uint16_t len) { + uint8_t *src = s; + uint8_t *dst = d; + uint8_t *data = c; uint16_t word16; uint32_t sum; uint16_t i; @@ -525,6 +534,7 @@ sum = ~sum; return htons((unsigned short) sum); } +#endif /* __KERNEL __ */ int convert_string_to_address_v4(const char *str, struct in_addr *ip) { === modified file 'lib/core/misc.h' --- lib/core/misc.h 2010-03-19 09:24:10 +0000 +++ lib/core/misc.h 2010-03-19 09:32:05 +0000 @@ -320,7 +320,7 @@ struct in6_addr *src_hit, struct in6_addr *dst_hit); -uint16_t ipv4_checksum(uint8_t protocol, uint8_t src[], uint8_t dst[], uint8_t data[], uint16_t len); +uint16_t ipv4_checksum(uint8_t protocol, void *s, void *d, void *c, uint16_t len); /* openSSL wrapper functions for base64 encoding and decoding */ === modified file 'lib/performance/performance.c' --- lib/performance/performance.c 2010-03-03 13:16:18 +0000 +++ lib/performance/performance.c 2010-03-19 09:32:05 +0000 @@ -10,6 +10,9 @@ * <a href="http://www.gnu.org/licenses/gpl.txt";>GNU/GPL</a>. * */ + +#include <sys/time.h> + #include "performance.h" #include "lib/core/debug.h" #include "lib/core/ife.h" === modified file 'release.version' --- release.version 2010-03-19 09:28:49 +0000 +++ release.version 2010-03-19 09:32:05 +0000 @@ -1,2 +1,2 @@ -Version: 1.0.5 -Release: 0 +Version: 1.0.6 +Release: 2