<div dir="ltr"><div dir="ltr"><div dir="ltr">Hello,<div>Thank you for reporting this bug.</div><div>It should be fixed by <a href="https://github.com/named-data/YaNFD/commit/f7767468f3d4540e468bc0bd5a195066eb2a20d4">https://github.com/named-data/YaNFD/commit/f7767468f3d4540e468bc0bd5a195066eb2a20d4</a></div><div>Best wishes,</div><div>Xinyu Ma.</div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2022年9月21日(水) 3:00 郝广宇 <<a href="mailto:haoguangyu@chorustek.com">haoguangyu@chorustek.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>I have a YaNFD issue of that failed with "nfdc face create remote tcp4://X.X.X.X:6363", I read the source code that not tcp supported, the following is the code.</div><div>No case of tcpURI? </div><div><br></div><div>// Canonize attempts to canonize the URI, if not already canonical.</div><div>func (u *URI) Canonize() error {</div><div> switch u.uriType {</div><div> case devURI, fdURI:</div><div> // Nothing to do to canonize these</div><div> case ethernetURI:</div><div> mac, err := net.ParseMAC(strings.Trim(u.path, "[]"))</div><div> if err != nil {</div><div> return core.ErrNotCanonical</div><div> }</div><div> u.scheme = "ether"</div><div> u.path = mac.String()</div><div> u.port = 0</div><div> case udpURI:</div><div> path := u.path</div><div> zone := ""</div><div> if strings.Contains(u.path, "%") {</div><div> // Has zone, so separate out</div><div> path = u.PathHost()</div><div> zone = "%" + u.PathZone()</div><div> }</div><div> ip := net.ParseIP(strings.Trim(path, "[]"))</div><div> if ip == nil {</div><div> // Resolve DNS</div><div> resolvedIPs, err := net.LookupHost(path)</div><div> if err != nil || len(resolvedIPs) == 0 {</div><div> return core.ErrNotCanonical</div><div> }</div><div> ip = net.ParseIP(resolvedIPs[0])</div><div> if ip == nil {</div><div> return core.ErrNotCanonical</div><div> }</div><div> }</div><div><br></div><div> if ip.To4() != nil {</div><div> u.scheme = "udp4"</div><div> u.path = ip.String() + zone</div><div> } else if ip.To16() != nil {</div><div> u.scheme = "udp6"</div><div> u.path = ip.String() + zone</div><div> } else {</div><div> return core.ErrNotCanonical</div><div> }</div><div> case unixURI:</div><div> u.scheme = "unix"</div><div> testPath := "/" + u.path</div><div> if runtime.GOOS == "windows" {</div><div> testPath = u.path</div><div> }</div><div> fileInfo, err := os.Stat(testPath)</div><div> if err != nil && !os.IsNotExist(err) {</div><div> // File couldn't be opened, but not just because it doesn't exist</div><div> return core.ErrNotCanonical</div><div> } else if err == nil && fileInfo.IsDir() {</div><div> // File is a directory</div><div> return core.ErrNotCanonical</div><div> }</div><div> u.port = 0</div><div> default:</div><div> return core.ErrNotCanonical</div><div> }</div><div><br></div><div> return nil</div><div>}</div></div>
_______________________________________________<br>
Nfd-dev mailing list<br>
<a href="mailto:Nfd-dev@lists.cs.ucla.edu" target="_blank">Nfd-dev@lists.cs.ucla.edu</a><br>
<a href="https://www.lists.cs.ucla.edu/mailman/listinfo/nfd-dev" rel="noreferrer" target="_blank">https://www.lists.cs.ucla.edu/mailman/listinfo/nfd-dev</a><br>
</blockquote></div>