spf-discuss
[Top] [All Lists]

Another macro letter required besides 'i'

2004-03-22 15:57:00
Wayne wrote:

While adding IPv6 support for libspf-alt v0.3, I noticed this very
same thing.  I talked with Meng about this a bit, and what I ended up
doing is using the dotted-nibble format if and only if the ip-address
has the 'reverse' flag.  (e.g. %{ir}).  Otherwise, it uses the C
library routine inet_ntop function.

The C routine that I made uses the dotted-nibble format if the macro is used
for producing a domain name (because ':' are not allowed in domain names),
otherwise it uses the same format that BIND displays (probably BIND uses the
inet_ntop function)

But for the explanation string we need a macro "%{c}" that produces a
string in following format:

I thought about a new variable, but what would be the semantics for
IPv4?  How do you write an SPF record that works for both IPv4 and IPv6?

I don't understand what you mean.

::FFFF:18.52.86.120

pardon my ignorance, but is this a valid IPv6 address?  (Yes, I know
that there is an IPv4<->IPv6 mapping, but I thought all IPv6 addresses
required colons instead of dots.)

According to RFC 2373 there are three conventional forms for representing
IPv6 addresses as text strings:

1)  x:x:x:x:x:x:x:x
2)  x:x:x:x:x:x:d.d.d.d
3)  one of above with :: instead a run of zeros.

BIND writes ::x:x as ::d.d.d.d and ::FFFF:x:x as ::FFFF:d.d.d.d


Roger