Committer: Rene Hummen <rene.hummen@xxxxxxxxxxxxxxxxx> Date: Tue Feb 16 19:34:59 2010 +0100 Revision: 3592 Revision-id: rene.hummen@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Branch nick: packaging Log: added error messages Modified: M hipd/netdev.c M lib/core/misc.c === modified file 'hipd/netdev.c' --- hipd/netdev.c 2010-02-16 11:48:47 +0000 +++ hipd/netdev.c 2010-02-16 18:34:59 +0000 @@ -294,7 +294,9 @@ if (mapped) { in6 = (const struct in6_addr * ) hip_cast_sa_addr((struct sockaddr *) (&n->addr)); + _HIP_DEBUG_IN6ADDR("in6:", in6); in = (const struct in_addr *) hip_cast_sa_addr(addr); + HIP_DEBUG_INADDR("in:", in); addr_match = IPV6_EQ_IPV4(in6, in); family_match = 1; } else if (!mapped && addr->sa_family == AF_INET6) { === modified file 'lib/core/misc.c' --- lib/core/misc.c 2010-02-12 10:47:40 +0000 +++ lib/core/misc.c 2010-02-16 18:34:59 +0000 @@ -1631,6 +1631,8 @@ void *hip_cast_sa_addr(const struct sockaddr *sa) { if (sa == NULL) { + HIP_ERROR("sockaddr is NULL, skipping type conversion\n"); + return NULL; } @@ -1640,6 +1642,7 @@ case AF_INET6: return &(((struct sockaddr_in6 *) sa)->sin6_addr); default: + HIP_ERROR("unknown type, skipping type conversion\n"); return NULL; } } @@ -1952,15 +1955,15 @@ /** * Gets the state of the bex for a pair of ip addresses. - * @param *src_ip input for finding the correct entries - * @param *dst_ip input for finding the correct entries - * @param *src_hit output data of the correct entry - * @param *dst_hit output data of the correct entry - * @param *src_lsi output data of the correct entry - * @param *dst_lsi output data of the correct entry + * @param *src_ip input for finding the correct entries + * @param *dst_ip input for finding the correct entries + * @param *src_hit output data of the correct entry + * @param *dst_hit output data of the correct entry + * @param *src_lsi output data of the correct entry + * @param *dst_lsi output data of the correct entry * - * @return the state of the bex if the entry is found - * otherwise returns -1 + * @return the state of the bex if the entry is found + * otherwise returns -1 */ int hip_get_bex_state_from_LSIs(hip_lsi_t *src_lsi, hip_lsi_t *dst_lsi, @@ -2245,11 +2248,10 @@ * connected to a particular port * connected to an lsi ip address. * - * @param port_dest the port number of the socket - * @param *proto protocol type + * @param port_dest the port number of the socket + * @param *proto protocol type * - * @return 1 if it finds the required socket - * 0 otherwise + * @return 1 if it finds the required socket, 0 otherwise */ int hip_get_proto_info(in_port_t port_dest, char *proto) {