diff --git a/notice.go b/notice.go index af1c032..aa8818b 100644 --- a/notice.go +++ b/notice.go @@ -248,7 +248,13 @@ func DecodeRawNotice(r *RawNotice) (*Notice, error) { var senderAddress net.IP if len(r.HeaderFields) > senderSockaddrIndex { - ipBytes, err := DecodeZcode(r.HeaderFields[senderSockaddrIndex]) + sockaddrField := r.HeaderFields[senderSockaddrIndex] + var ipBytes []byte + if len(sockaddrField) != 0 && sockaddrField[0] == 'Z' { + ipBytes, err = DecodeZcode(sockaddrField) + } else { + ipBytes, err = DecodeZAscii(sockaddrField) + } if err != nil { return nil, err } diff --git a/raw_notice.go b/raw_notice.go index 7c37603..6e4ac4d 100644 --- a/raw_notice.go +++ b/raw_notice.go @@ -130,7 +130,7 @@ const ( multipartIndex // string multiuidIndex // 12-byte zascii // Added in 2009; no version bump - senderSockaddrIndex // zcode + senderSockaddrIndex // zcode or zascii charsetIndex // zascii16 little-endian // Other fields numKnownFields