Project

General

Profile

Bug #2031

fib/add-nexthop: FaceId should be optional

Added by Tai-Lin Chu almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Management
Target version:
Start date:
10/06/2014
Due date:
% Done:

100%

Estimated time:
1.00 h

Description

Steps to reproduce:

  1. send a fib/add-nexthop command without FaceId field in the parameter.

Expected: FaceId is implied as the requesting Face.

Actual: 400 error

History

#1 Updated by Junxiao Shi almost 5 years ago

Please provide a code snippet to reproduce this issue.

#2 Updated by Tai-Lin Chu almost 5 years ago

fib add-nexthop?

I actually find the bug. It is pretty obvious.

https://github.com/named-data/NFD/blob/68bc1e0dce68c0a0ef98fe5e3fee15a4d8b21fc8/daemon/mgmt/fib-manager.cpp#L146

that !parameters.hasFaceId()

#3 Updated by Junxiao Shi almost 5 years ago

  • Subject changed from face id cannot be ignored to fib/add-nexthop: FaceId should be optional
  • Description updated (diff)
  • Category set to Management
  • Target version set to v0.3
  • Estimated time set to 1.00 h

#4 Updated by Tai-Lin Chu almost 5 years ago

https://github.com/named-data/NFD/commit/7564d97d135b3fc9bb1150cdfb7505177813f572

The origin commit that introduces the bug. I guess it is not a bug back then.

#5 Updated by Junxiao Shi almost 5 years ago

  • Assignee set to Tai-Lin Chu

Please cancel GitHub pull request, and submit the patch to Gerrit for review.

#6 Updated by Junxiao Shi almost 5 years ago

The face ID is optional only for self registrations, not for any other fib operations to add routes.

No. fib/add-nexthop command allows optional FaceId.

#7 Updated by Lan Wang almost 5 years ago

In what situation is the optional faceID needed? If there has not been any problems so far, I assume nrd always supplies the faceID.

#8 Updated by Junxiao Shi almost 5 years ago

The protocol allows omitting FaceId. The default value of FaceId is 0, which means "the requesting face".

nrd always setting FaceId doesn't mean FibManager can violate protocol.

#9 Updated by Lan Wang almost 5 years ago

I was asking why the protocol defines the FaceID as optional. If I understand correctly, the fib commands are issued only by nrd. Applications do not directly interact with nfd to register their prefixes, but the optional FaceID is useful only in this case.

#10 Updated by Junxiao Shi almost 5 years ago

The recommended way to represent "self" is omitting the FaceId field. This is consistent with other commands such as faces/enable-local-control and rib/register.

Allowing FaceId=0 is due to historical reason.

#11 Updated by Alex Afanasyev almost 5 years ago

  • Status changed from New to Code review

#12 Updated by Junxiao Shi almost 5 years ago

  • Status changed from Code review to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF