Skip to contentSkip to conversation

ipv6 address comparison

DISCUSSION Arif Hossain 2 participants 3 messages Jul 21, 2012 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hi,

My module uses ipv6_addr_cmp() from <linux/ipv6.h>.

<linux/ipv6.h>
static inline int ipv6_addr_cmp(const struct in6_addr *a1, const struct in6_addr *a2)

{
	return memcmp(a1, a2, sizeof(struct in6_addr));
}

I've included <linux/ipv6.h>. But when i try to build the module i get following error:

net/netfilter/xt_ipaddr.c:81: error: implicit declaration of function ?ipv6_addr_cmp?

Although before the call to ipv6_addr_cmp, i have a casting to struct ipv6hdr *iph. So the definitions from ipv6.h should be available to my module.

cheers.
aft

#1 lore raw
Quoted 21 lines · Arif Hossain

Hi,

My module uses ipv6_addr_cmp() from <linux/ipv6.h>.

<linux/ipv6.h>
static inline int ipv6_addr_cmp(const struct in6_addr *a1, const struct in6_addr *a2)

{
	return memcmp(a1, a2, sizeof(struct in6_addr));
}

I've included <linux/ipv6.h>. But when i try to build the module i get following error:

net/netfilter/xt_ipaddr.c:81: error: implicit declaration of function ???ipv6_addr_cmp???

Although before the call to ipv6_addr_cmp, i have a casting to struct ipv6hdr *iph. So the definitions from ipv6.h should be available to my module.

Quoted 8 lines

cheers.
aft

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Well, you included <linux/ipv6.h>. Here, the implementation of ipv6_addr_cmp() is in <net/ipv6.h>.

Regards,
Tobi

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 21 lines · Sven-Haegar Koch
Quoted 12 lines · Arif Hossain

My module uses ipv6_addr_cmp() from <linux/ipv6.h>.

<linux/ipv6.h>
static inline int ipv6_addr_cmp(const struct in6_addr *a1, const struct in6_addr *a2)

{
	return memcmp(a1, a2, sizeof(struct in6_addr));
}

I've included <linux/ipv6.h>. But when i try to build the module i get following error:

Quoted 6 lines

net/netfilter/xt_ipaddr.c:81: error: implicit declaration of function ?ipv6_addr_cmp?

Although before the call to ipv6_addr_cmp, i have a casting to struct ipv6hdr *iph. So the definitions from ipv6.h should be available to my module.

Quoted 9 lines

In my 3.2.0 source tree here the definition is in include/net/ipv6.h, not in include/linux/ipv6.h

c'ya
sven-haegar

Signature · 2 lines
Three may keep a secret, if two of them are dead.
- Ben F.

Thanks for the reply. Now its working.
cheers