Project

General

Profile

Bug #4474

FaceUri throws "Malformed URI" for IPv6 UDP multicast address

Added by Ashlesh Gawande about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Category:
Net
Target version:
Start date:
01/24/2018
Due date:
% Done:

100%

Estimated time:

Description

NLSR passes in the URI it gets from NFD Face Creation Event to FaceUri
(https://github.com/named-data/NLSR/blob/563611eb20ff9a6d9e22f446f8a813cb32e811c0/src/nlsr.cpp?utf8=%E2%9C%93#L460)
and gets a Malformed error, example:

Malformed URI: udp6://[ff02::1234%a-eth0]:56363

Related issues

Related to ndn-cxx - Feature #4324: FaceUri: per-scheme parsingIn Progress

Related to NFD - Feature #1428: TCP/UDP face with link-local IPv6 addressClosed

History

#1 Updated by Junxiao Shi about 1 year ago

#2 Updated by Davide Pesavento about 1 year ago

  • Description updated (diff)
  • Target version set to v0.7

#3 Updated by Junxiao Shi about 1 year ago

FaceUri parser is not recognizing the device name part correctly.
Device name rules are quite relaxed, see dev_valid_name.
There’s probably additional encoding when converting to IPv6 link local address.

#4 Updated by Davide Pesavento about 1 year ago

  • Related to Feature #1428: TCP/UDP face with link-local IPv6 address added

#5 Updated by Davide Pesavento about 1 year ago

Junxiao Shi wrote:

FaceUri parser is not recognizing the device name part correctly.

Yes, we're only accepting [a-zA-Z0-9]+, which is wrong.

There’s probably additional encoding when converting to IPv6 link local address.

I don't understand this sentence.

#6 Updated by Davide Pesavento about 1 year ago

  • Subject changed from FaceUri throws malformed URI for IPv6 UDP multicast address to FaceUri throws "Malformed URI" for IPv6 UDP multicast address
  • Status changed from New to Code review
  • Assignee set to Davide Pesavento
  • % Done changed from 0 to 100

#7 Updated by Junxiao Shi about 1 year ago

There’s probably additional encoding when converting to IPv6 link local address.

I wonder what happens if interface name contains % ] or other characters that cannot appear in URI. I couldn’t find answers in kernel, libpcap, or getsockaddr (of Python) sources.

Eventually we should canonize zone index to the numeric form, but that’s left for another issue.

#8 Updated by Davide Pesavento about 1 year ago

Junxiao Shi wrote:

There’s probably additional encoding when converting to IPv6 link local address.

I wonder what happens if interface name contains % ] or other characters that cannot appear in URI. I couldn’t find answers in kernel, libpcap, or getsockaddr (of Python) sources.

That's an URI encoding issue. Kernel, libpcap, getsockaddr don't deal with URIs.

According to the URI RFC, all reserved chars should be escaped. IIRC however, Alex decided to ignore this rule at least for '%'.

#9 Updated by Davide Pesavento about 1 year ago

In any case, change 4474 is intended to be a quick fix, since the FaceUri parser is being completely rewritten in #4324 anyway. We can decide to reject weird characters in interface names (only accept e.g. '-' and '_') if that simplifies things for now. If anyone is using weird characters to name interfaces, they should be shot.

#10 Updated by Junxiao Shi about 1 year ago

We can decide to reject weird characters in interface names (only accept e.g. '-' and '_') if that simplifies things for now.

Yes rejecting some chars is fine.

they should be shot.

See https://github.com/named-data/NFD/blob/97a010178c0bd340babb3dfabcc6f8f6abbaef42/CODE_OF_CONDUCT.md "our standards" section.

#11 Updated by Davide Pesavento about 1 year ago

  • Status changed from Code review to Closed

Also available in: Atom PDF