Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NRF target-plmn-list is an array which is not parsed correctly #41

Closed
albertoberlin opened this issue Jun 12, 2024 · 1 comment
Closed

Comments

@albertoberlin
Copy link

Hello,

in the file https://github.com/free5gc/nrf/blob/72c93a38cb17930f87901c28f3eb51277ce55d39/internal/sbi/producer/nf_discovery.go#L273C1-L273C47 it handles a discovery that arrives with a target-plmn-list
According to the 3GPP Standard the target-plmn-list is an array of PlmnId but the code doesn't handle correctly the [] of the array

I tested with a curl request after I had registered the NFs,

curl --http2-prior-knowledge -H "User-Agent: SCP" -H "Content-type: application/json" "http://X.Y.Z.W:V/nnrf-disc/v1/nf-instances?target-nf-type=AUSF&requester-nf-type=AMF&target-plmn-list=\[\{\"mcc\":\"999\",\"mnc\":\"01\"\}\]"

I added an extra log line before the issue to see it, if you see a correct discovery request gives an error

2024-06-10T13:25:25.789628634+02:00 [INFO][NRF][DISC] Handle NFDiscoveryRequest
2024-06-10T13:25:25.789733796+02:00 [WARN][NRF][DISC] Before the error the string is [{"mcc":"999","mnc":"01"}]
2024-06-10T13:25:25.789782108+02:00 [WARN][NRF][DISC] Unmarshal Error in targetPlmnListtruct: json: cannot unmarshal array into Go value of type models.PlmnId
2024-06-10T13:25:25.791295270+02:00 [INFO][NRF][GIN] | 200 | 172.28.112.214 | GET | /nnrf-disc/v1/nf-instances?target-nf-type=AUSF&requester-nf-type=AMF&service-names=nausf-auth&target-plmn-list=[{"mcc":"999","mnc":"01"}] |

An incorrect request without the [] doesn't show the error

curl --http2-prior-knowledge -H "User-Agent: SCP" -H "Content-type: application/json" "http://X.Y.Z.W:V/nnrf-disc/v1/nf-instances?target-nf-type=AUSF&requester-nf-type=AMF&target-plmn-list=\{\"mcc\":\"999\",\"mnc\":\"01\"\}"

2024-06-10T13:32:16.912941652+02:00 [INFO][NRF][DISC] Handle NFDiscoveryRequest
2024-06-10T13:32:16.913020873+02:00 [WARN][NRF][DISC] Before the error the string is {"mcc":"999","mnc":"01"}
2024-06-10T13:32:16.918108251+02:00 [INFO][NRF][GIN] | 200 | 172.28.112.214 | GET | /nnrf-disc/v1/nf-instances?target-nf-type=AUSF&requester-nf-type=AMF&target-plmn-list={"mcc":"999","mnc":"01"} |

@lyz508
Copy link

lyz508 commented Jun 17, 2024

Hi, @albertoberlin

Thank you for your feedback.
This error will be fixed after the NRF refactor is released.
You can refer to this PR to check on the progress of the refactor.

Regards,

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

No branches or pull requests

3 participants