Skip to content

Commit

Permalink
[portsyncd]: Update the MTU on host interfaces if config DB changes (s…
Browse files Browse the repository at this point in the history
…onic-net#375)

Signed-off-by: Haiyang Zheng <haiyang.z@alibaba-inc.com>
  • Loading branch information
hzheng5 authored and Shuotian Cheng committed Nov 10, 2017
1 parent 165e2dc commit b4b7f1d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions portsyncd/portsyncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "producerstatetable.h"
#include "portsyncd/linksync.h"
#include "subscriberstatetable.h"
#include "exec.h"

#define DEFAULT_PORT_CONFIG_FILE "port_config.ini"

Expand Down Expand Up @@ -250,6 +251,19 @@ void handlePortConfig(ProducerStateTable &p, map<string, KeyOpFieldsValuesTuple>
if (op == SET_COMMAND)
{
p.set(key, values);
for (auto fv : values)
{
string field = fvField(fv);
string value = fvValue(fv);

/* Update the mtu field on host interface */
if (field == "mtu")
{
string cmd, res;
cmd = "ip link set " + key + " mtu " + value;
swss::exec(cmd, res);
}
}
}

it = port_cfg_map.erase(it);
Expand Down

0 comments on commit b4b7f1d

Please sign in to comment.