multiformats/java-multiaddr

No protocol with code: 273 (UDP). Works in js-multiaddr

Closed this issue · 5 comments

Hi, I am using this to play with IPFS, but am observing quite a few decode errors when used in the wild.

Concrete example:

'049f598d1d91021573cc03' throws an Exception decoding (java.lang.IllegalStateException: No protocol with code: 273)
Using js-multiaddr it decodes correctly as "/ip4/159.89.141.29/udp/5491/quic"

In this example

<04> 9f 59 8d 1d // (4) ip4 address
<91 02> 15 73 // (273) udp port
<cc 03> // (460) quic

Looks like the UDP protocol ID just needs changing from 17 to 273?

Have confirmed that changing the protocol ID for UDP fixes the decoding issues, but I am not aware if it has side effects or removes support for a previous encoding etc.

Yep, it looks like this was changed without telling us. I'll update and add some more missing new protocols.

This is fixed in master now

Great thanks! Will let you know if I see any other issues decoding from the wild!