gamelinux/prads — pull request #39 by madmac2501 (2014-01-01 12:47:06+00:00)
Title: Don't compare connections from different IP protocol versions

Hi,

I found that when there is a collision in the hash among an IPv4 and IPv6 connection there is a comparison between uninitialized values. The IPv4 connection doesn't have some values initialized to be compared with an IPv6 connection.

with this two connections it is reproducible, thank you

(gdb) p af
$3 = 2
(gdb) p *ip_src
$4 = {__in6_u = {
__u6_addr8 = "\254\025\001\006 \000\000\000\000\000\000\000\000\000\000",
__u6_addr16 = {5548, 1537, 32, 0, 0, 0, 0, 0}, __u6_addr32 = {100734380,
32, 0, 0}}}
(gdb) p *ip_dst
$5 = {__in6_u = {
__u6_addr8 = "\nd\000\t\001\004\000\000\000\000\000\000\000\000\000",
__u6_addr16 = {25610, 2304, 1025, 0, 0, 0, 0, 0}, __u6_addr32 = {
151020554, 1025, 0, 0}}}
(gdb) p src_port
$6 = 16935
(gdb) p dst_port
$7 = 41170

(gdb) p af
$11 = 10
(gdb) p *ip_src
$12 = {__in6_u = {
__u6_addr8 = "\376\200\000\000\000\000\000\000\002%\220\377\376\nw\231",
__u6_addr16 = {33022, 0, 0, 0, 9474, 65424, 2814, 39287}, __u6_addr32 = {
33022, 0, 4287636738, 2574715646}}}
(gdb) p *ip_dst
$13 = {__in6_u = {
__u6_addr8 = "\377\002", '\000' , "\001\000\002",
__u6_addr16 = {767, 0, 0, 0, 0, 0, 256, 512}, __u6_addr32 = {767, 0, 0,
33554688}}}
(gdb) p src_port
$14 = 8706
(gdb) p dst_port
$15 = 8962
(gdb) p pi->proto
$16 = 17 '\021'