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
GetKeys() parsing IPv6 addresses incorrectly #29
Comments
@justinejose91 -- can you provide the dump of redis KEYS output for the table? |
Looks like the AppDB has ":" key separator. If the key itself has ":" then how to tell if it is a separator or part of the key ? If the ":" can only appear in the last key, then can we pass the # of keys in the TableSpec parameter ? |
root@sonic:~# redis-cli
|
@a-barboza could you give more information on how to solve this issue? |
I talked to some users of AppDB here, and they mentioned that each application knows how to distinguish the ":" as a key separator or part of the key based on some knowledge. So, my proposal is to add additional field in TableSpec. Eg: TableSpec { Name: "INTF_TABLE", CompCt: 2 }. Now, the db has some additional information to allow the entry number 23 to be returned correctly as Should we try this approach ? |
Yes, I could try, as per our conversation. I will update you soon. Thanks for the info. |
Hey @a-barboza , I checked it and modified some code in db.go, which works fine.
} |
Hi Justine, I believe this is on the right track. As you suspected, since this is a generic function, the line should probably change to (in the style of C ternary operator) or whatever the Go equivalent is. I will put these changes in tomorrow, and attempt to push them. thanks for finding the issue. |
Yes @a-barboza , this works. Please do let me know once your fix is in. Thank you :) |
@justinejose91 . Ok, the fix is in. Will wait till tomorrow for the push to project-arlo master |
@a-barboza -- has the fix been pushed to |
@jeff-yin , fixes are in brcm_poc branch. He will push it to master today. This is what @a-barboza updated yesterday. |
Changes are merged. Thanks @a-barboza |
When we get the IPv6 address from redis-db for an interface, say a::b/64, and the api used is
GetKeys()
, I am gettingkey[]
asIt's supposed to come as
Since the separator is ':', its parsing it wrongly. Works fine for IPv4 addresses.
The text was updated successfully, but these errors were encountered: