Mercurial > dovecot > core-2.2
comparison src/lib/net.c @ 19534:25e892203e2b
lib: Fixed assert-crash with net_is_in_network(family=ipv6, family=0, ..)
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Mon, 04 Jan 2016 14:00:19 -0500 |
parents | c5c34c02fda3 |
children | 0f22db71df7a |
comparison
equal
deleted
inserted
replaced
19533:06825c099fa1 | 19534:25e892203e2b |
---|---|
1123 if (net_ipv6_mapped_ipv4_convert(ip, &tmp_ip) == 0) { | 1123 if (net_ipv6_mapped_ipv4_convert(ip, &tmp_ip) == 0) { |
1124 /* IPv4 address mapped disguised as IPv6 address */ | 1124 /* IPv4 address mapped disguised as IPv6 address */ |
1125 ip = &tmp_ip; | 1125 ip = &tmp_ip; |
1126 } | 1126 } |
1127 | 1127 |
1128 if (ip->family == 0) { | 1128 if (ip->family == 0 || net_ip->family == 0) { |
1129 /* non-IPv4/IPv6 address (e.g. UNIX socket) never matches | 1129 /* non-IPv4/IPv6 address (e.g. UNIX socket) never matches |
1130 anything */ | 1130 anything */ |
1131 return FALSE; | 1131 return FALSE; |
1132 } | 1132 } |
1133 if (IPADDR_IS_V4(ip) != IPADDR_IS_V4(net_ip)) { | 1133 if (IPADDR_IS_V4(ip) != IPADDR_IS_V4(net_ip)) { |