Skip to content

fw: add all satisfied PIT entry nonces to dead nonce list on multi-match Data - #212

Open
Harsh23Kashyap wants to merge 1 commit into
named-data:mainfrom
Harsh23Kashyap:fix/dnl-multi-pit-match
Open

Harsh23Kashyap wants to merge 1 commit into
named-data:mainfrom
Harsh23Kashyap:fix/dnl-multi-pit-match

Conversation

@Harsh23Kashyap

Copy link
Copy Markdown

Fixes #209.

Summary

When a Data packet satisfies more than one PIT entry (e.g. a CanBePrefix Interest for /a and an exact-match Interest for /a/b), the satisfy loop in processIncomingData inserted the out-record nonces of pitEntries[0] into the dead nonce list once per entry, and never recorded the nonces of the remaining entries. A looped Interest carrying one of those unrecorded nonces is then not detected and gets forwarded again until its PIT entry expires.

The fix uses the loop variable pitEntry, matching the single-match branch directly above.

Repro evidence

Go 1.26.6, linux/amd64, ndnd main @ d51682b.

Regression test against unpatched main:

$ go test ./fw/fw/ -run TestDataMultiPitMatchDeadNonceList -v
=== RUN   TestDataMultiPitMatchDeadNonceList
    thread_test.go:88:
        	Error:      	Should be true
        	Messages:   	nonce of /a entry missing from DNL
--- FAIL: TestDataMultiPitMatchDeadNonceList (0.00s)
FAIL
FAIL	github.com/named-data/ndnd/fw/fw	0.004s

Same test against this branch:

$ go test ./fw/fw/ -run TestDataMultiPitMatchDeadNonceList -v
=== RUN   TestDataMultiPitMatchDeadNonceList
--- PASS: TestDataMultiPitMatchDeadNonceList (0.00s)
PASS
ok  	github.com/named-data/ndnd/fw/fw	0.003s

Testing

  • New regression test TestDataMultiPitMatchDeadNonceList: two pending Interests (/a CanBePrefix nonce 1111, /a/b exact nonce 2222) with out-records upstream; Data /a/b satisfies both; asserts both nonces land in the dead nonce list. Fails before the fix, passes after.
  • go test ./... - all 22 packages pass.
  • go vet ./fw/... and gofmt clean.

…tch Data

When a Data packet satisfies multiple PIT entries (e.g. one CanBePrefix
and one exact-match Interest), the forwarding loop inserted the out-record
nonces of only the first matching entry into the dead nonce list, once per
entry. Nonces used upstream for the remaining entries were never recorded,
so a looped Interest carrying one of those nonces is not detected and can
circulate until its PIT entry expires.

Use the loop variable so every satisfied entry's out-record nonces are
added, matching the single-match path. Add a regression test that satisfies
two PIT entries with one Data packet and checks both nonces land in the
dead nonce list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fw: Data satisfying multiple PIT entries only records the first entry's nonces in the dead nonce list

1 participant