zephyr-im / zephyr

An institutional/enterprise-scale distributed real-time messaging and notification system
35 stars 11 forks source link

Send IPv4 as ASCII, not ZCode, when doing v4 braindumps #94

Closed andersk-auto closed 10 years ago

andersk-auto commented 10 years ago

At some point, a header field was added to carry the sender's actual IP address, to help in cases when the 32-bit field in the UID is not sufficient. As it turns out, the same field was already being used by bdump code for a similar purpose. However, while the bdump code originally used an ASCII-encoded IP address, the new code always uses ZCode. Unfortunately, this doesn't interoperate.

The solution was to handle both ASCII and ZCode encoding on incoming notices, and to use ZMakeAscii when encoding IPv4 addresses in outgoing notices. Unfortunately, the latter was only done in Z_FormatRawHeader, which was recently refactored to use Z_ZCodeFormatRawHeader. To make things interoperate again, we need to make Z_ZCodeFormatRawHeader use old-style encoding for IPv4 addresses.

There is a possibility of introducing a new interop problem, as there was a period of a couple of weeks in 2009 when ZParseNotice would reject incoming notices in which the IP address field is present but not ZCode-encoded. I think the risk here is small, however, as there do not appear to have been any releases done during that period.

andersk-auto commented 10 years ago

Imported from trac issue 94. Created by jhutz@CS.CMU.EDU on 2013-02-12T19:45:51, last modified: 2013-02-18T01:44:33

andersk-auto commented 10 years ago

Trac comment by jhutz@CS.CMU.EDU on 2013-02-12 19:46:04:

Patch forthcoming

andersk-auto commented 10 years ago

Trac comment by kcr@ATHENA.MIT.EDU on 2013-02-16 19:07:55:

fixed in b92153fac201a9a22779817be5f2375f7cf754fc

andersk-auto commented 10 years ago

Trac comment by jhutz@CS.CMU.EDU on 2013-02-16 21:54:16:

Reverted, as the proposed fix prevents getting subs in ATHENA.MIT.EDU

andersk-auto commented 10 years ago

Trac comment by jhutz@CS.CMU.EDU on 2013-02-18 01:44:33:

fixed in 1076f98863a6a5c740dc9f6554c11fc9c75b0899