Re: [Mimedefang] [Patch] relay_is_* not ipv6 friendly (IPv4 Compatible patch)

2010-02-04 Thread David F. Skoll
- wrote: [A bunch of silly nitpicks] Feel free to fork the code if you like. Regards, David. ___ NOTE: If there is a disclaimer or other legal boilerplate in the above message, it is NULL AND VOID. You may ignore it. Visit http://www.mimedefang.org

Re: [Mimedefang] [Patch] relay_is_* not ipv6 friendly (IPv4 Compatible patch)

2010-02-04 Thread Bernd Petrovitsch
On Mit, 2010-02-03 at 12:32 -0800, - wrote: [...] Using the latter-above code, $2 is the IPv4, and if $1 is anything ACK, for real world use the ( must be annotated so that $1 always is the IPv4 address (or it's empty). other than ::, then the address was not machine generated and it's likely

Re: [Mimedefang] [Patch] relay_is_* not ipv6 friendly (IPv4 Compatible patch)

2010-02-03 Thread David F. Skoll
- wrote: Try this regex for detecting an IPv4-compatible IPv6 address: ... =~ qr/^:::(\d{1,3}(\.\d{1,3}){3})$/i ... How about some C code rather than perl? -- David. ___ NOTE: If there is a disclaimer or other legal boilerplate in the above

Re: [Mimedefang] [Patch] relay_is_* not ipv6 friendly (IPv4 Compatible patch)

2010-02-03 Thread David F. Skoll
Bernd Petrovitsch wrote: Perhaps reason enough to simply use Net::IP. What, from C? :) As I said... patches (in C) accepted happily. Regards, David. ___ NOTE: If there is a disclaimer or other legal boilerplate in the above message, it is NULL AND

Re: [Mimedefang] [Patch] relay_is_* not ipv6 friendly (IPv4 Compatible patch)

2010-02-03 Thread Bernd Petrovitsch
On Mit, 2010-02-03 at 07:01 -0500, David F. Skoll wrote: Bernd Petrovitsch wrote: Perhaps reason enough to simply use Net::IP. What, from C? :) Oops, sorry, I had the impression it´s in the perl part. Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at

Re: [Mimedefang] [Patch] relay_is_* not ipv6 friendly (IPv4 Compatible patch)

2010-02-03 Thread David F. Skoll
Hi, Here's my compromise on the IPv4-mapped IPv6 address question: if (tmp) { if (IN6_IS_ADDR_V4MAPPED(in6sa-sin6_addr) || IN6_IS_ADDR_V4COMPAT(in6sa-sin6_addr)) { if (strchr(data-hostip, '.')) { char

Re: [Mimedefang] [Patch] relay_is_* not ipv6 friendly (IPv4 Compatible patch)

2010-02-03 Thread -
--- On Wed, 2/3/10, Bernd Petrovitsch be...@petrovitsch.priv.at wrote: On Die, 2010-02-02 at 17:49 -0800, - wrote: Try this regex for detecting an IPv4-compatible IPv6 address:   ... =~  qr/^:::(\d{1,3}(\.\d{1,3}){3})$/i   ... To get even more anal: No one forbids to avoid the

Re: [Mimedefang] [Patch] relay_is_* not ipv6 friendly (IPv4 Compatible patch)

2010-02-03 Thread -
--- On Wed, 2/3/10, David F. Skoll d...@roaringpenguin.com wrote: Here's my compromise on the IPv4-mapped IPv6 address question:         if (tmp) {         if (IN6_IS_ADDR_V4MAPPED(in6sa-sin6_addr) ||             IN6_IS_ADDR_V4COMPAT(in6sa-sin6_addr)) {             if (strchr(data-hostip,

Re: [Mimedefang] [Patch] relay_is_* not ipv6 friendly (IPv4 Compatible patch)

2010-02-03 Thread David F. Skoll
- wrote: Comments: if (strchr(data-hostip, '.')) { This conditional is redundant. No, it is not. inet_ntop does not *have* to use the form :::a.b.c.d for IPv4-compatible addresses. It's allowed to do that, but not mandated to. It could use :::aabb:ccdd If an

Re: [Mimedefang] [Patch] relay_is_* not ipv6 friendly (IPv4 Compatible patch)

2010-02-03 Thread -
--- On Wed, 2/3/10, David F. Skoll d...@roaringpenguin.com wrote: Date: Wednesday, February 3, 2010, 12:56 PM - wrote: Comments:          if (strchr(data-hostip, '.')) { This conditional is redundant. No, it is not.  inet_ntop does not *have* to use the form :::a.b.c.d for

Re: [Mimedefang] [Patch] relay_is_* not ipv6 friendly (IPv4 Compatible patch)

2010-02-02 Thread -
Try this regex for detecting an IPv4-compatible IPv6 address: ... =~ qr/^:::(\d{1,3}(\.\d{1,3}){3})$/i ... That should be more precise than strchr(...,'.'); $1 should be the IPv4 address that was extracted. ___ NOTE: If there is a