Skip to contentSkip to conversation

Fix IPv6 packet parsing.

PATCH Applied Eric Leblond 2 participants 4 messages May 23, 2008 – Jun 2, 2008 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix IPv6 packet parsing.

Source and destination addresses were put in ptr field of the target structure instead of being put in the new type ui128. The result was an improper value of the IPv6 source add destination addresses.

---
 filter/raw2packet/ulogd_raw2packet_BASE.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
filter/raw2packet/ulogd_raw2packet_BASE.c +4 -2
index b1f4113..a5312e4 100644
@@ -769,9 +769,11 @@ static int _interp_ipv6hdr(struct ulogd_pluginstance *pi, u_int32_t len)
 	if (len < sizeof(struct ip6_hdr))
 		return 0;
 
-	ret[KEY_IP_SADDR].u.value.ptr = &ipv6h->ip6_src;
+	memcpy(ret[KEY_IP_SADDR].u.value.ui128, &ipv6h->ip6_src,
+	       sizeof(ipv6h->ip6_src));
 	ret[KEY_IP_SADDR].flags |= ULOGD_RETF_VALID;
-	ret[KEY_IP_DADDR].u.value.ptr = &ipv6h->ip6_dst;
+	memcpy(ret[KEY_IP_DADDR].u.value.ui128, &ipv6h->ip6_dst,
+	       sizeof(ipv6h->ip6_dst));
 	ret[KEY_IP_DADDR].flags |= ULOGD_RETF_VALID;
 	ret[KEY_IP6_PAYLOAD_LEN].u.value.ui16 = ntohs(ipv6h->ip6_plen);
 	ret[KEY_IP6_PAYLOAD_LEN].flags |= ULOGD_RETF_VALID;
Signature · 1 line
1.5.4.3
maintainer Applied
#1 lore raw
Quoted 3 lines · Eric Leblond

Source and destination addresses were put in ptr field of the target structure instead of being put in the new type ui128. The result was an improper value of the IPv6 source add destination addresses.

Applied. Thanks.

I'll test this a bit along this week, any help appreciated. We can prepare the first release of 2.0.0-rc series soon. If my mind serves well, configuration file reload is still pending.

Signature · 1 line
"Los honestos son inadaptados sociales" -- Les Luthiers
#2 lore raw

Hello,

Quoted 10 lines · Pablo Neira Ayuso
Quoted 3 lines · Eric Leblond

Source and destination addresses were put in ptr field of the target structure instead of being put in the new type ui128. The result was an improper value of the IPv6 source add destination addresses.

Applied. Thanks.

I'll test this a bit along this week, any help appreciated. We can prepare the first release of 2.0.0-rc series soon. If my mind serves well, configuration file reload is still pending.

Yes, reload is still missing.

By the way, a new libnetfilter_conntrack release will be needed before ulogd2 rc. Latest libnetfilter_conntrack git is needed to have ulogd2 compile.

BR,

Signature · 3 lines
Eric Leblond
INL: http://www.inl.fr/
NuFW: http://www.nufw.org/
#3 lore raw
Quoted 9 lines · Eric Leblond
Quoted 3 lines

I'll test this a bit along this week, any help appreciated. We can prepare the first release of 2.0.0-rc series soon. If my mind serves well, configuration file reload is still pending.

Yes, reload is still missing.

By the way, a new libnetfilter_conntrack release will be needed before ulogd2 rc. Latest libnetfilter_conntrack git is needed to have ulogd2 compile.

I think that you have missed the release that I have done two days ago
[1] ? :-)

http://marc.info/?l=netfilter-devel&m=121225147116142&w=2

Signature · 1 line
"Los honestos son inadaptados sociales" -- Les Luthiers