Skip to content

[cfgmgr] Use sonic-swss-common instead of exec redis-cli#392

Merged
stcheng merged 1 commit intosonic-net:masterfrom
ishidawataru:dev
Nov 17, 2017
Merged

[cfgmgr] Use sonic-swss-common instead of exec redis-cli#392
stcheng merged 1 commit intosonic-net:masterfrom
ishidawataru:dev

Conversation

@ishidawataru
Copy link
Copy Markdown
Contributor

this enforces portablity of vlanmgrd

Signed-off-by: Wataru Ishida ishida.wataru@lab.ntt.co.jp

What I did

Use sonic-swss-common instead of executing redis-cli to get MAC address of the device.

Why I did it

This is kinda refactoring but I'm actually facing a problem with current implementation.

I'm running redis-server in a diffrent docker container from a container which runs sonic's daemons.
Two containers shares a redis unix socket file and doesn't share a network namespace.
In this case, vlanmgrd crashes since current implementation executes redis-cli directly to get MAC address.

Since we are passing DBConnector::DEFAULT_UNIXSOCKET to DBConnector , using sonic-swss-common can solve this issue.
Also, we can easily add an option to vlanmgrd for choosing how to connect to the redis server in the future.

How I verified it

Details if related

this enforces portablity of vlanmgrd

Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
* Dynamic switch_mac update is not supported for now.
*/
Table table(&cfgDb, "DEVICE_METADATA", CONFIGDB_TABLE_NAME_SEPARATOR);
std::vector<FieldValueTuple> ovalues;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need std::

@stcheng stcheng merged commit afa3e9f into sonic-net:master Nov 17, 2017
@ishidawataru ishidawataru deleted the dev branch November 18, 2017 01:23
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-swss that referenced this pull request Mar 1, 2023
Janetxxx pushed a commit to Janetxxx/sonic-swss that referenced this pull request Nov 10, 2025
…t#392)

This enforces portability of vlanmgrd

Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
jianyuewu pushed a commit to jianyuewu/sonic-swss that referenced this pull request Dec 24, 2025
…a memory leak would have occured if the methods format() or formatArgv() were to be used more than once on the same object. This change simply ensures that currently allocated memory gets freed before new memory gets allocated. (sonic-net#392)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants