gtp: no hardcoded values in ipv6_hashfn

Use sizeof(u32) instead of 4, cleanup for readability.
This commit is contained in:
Pablo Neira Ayuso 2014-02-13 17:15:59 +01:00
parent e0ffa33de9
commit b4cfa8fde5
1 changed files with 2 additions and 2 deletions

4
gtp.c
View File

@ -98,10 +98,10 @@ static inline u32 ipv4_hashfn(u32 ip)
static inline u32 ipv6_hashfn(struct in6_addr *ip6)
{
return jhash2((const u32 *) &ip6->s6_addr32, sizeof(*ip6)/4, gtp_h_initval);
return jhash2((const u32 *) &ip6->s6_addr32, sizeof(*ip6)/sizeof(u32),
gtp_h_initval);
}
/* resolve a PDP context structure based on the 64bit TID */
static struct pdp_ctx *gtp0_pdp_find(struct gtp_instance *gti, u64 tid)
{