-
Notifications
You must be signed in to change notification settings - Fork 63
Add ability to set MTU for network interface #261
Conversation
src/net.c
Outdated
| return 0; | ||
| } | ||
|
|
||
| static int hyper_set_interface_mtu(struct rtnl_handle *rth, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function duplicates a lot with hyper_set_interface_name(). Can you please make a common version for both of them?
src/net.c
Outdated
| req.n.nlmsg_flags = NLM_F_REQUEST; | ||
| req.n.nlmsg_type = RTM_SETLINK; | ||
| req.i.ifi_family = AF_UNSPEC; | ||
| req.i.ifi_index = ifindex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to set ifi_change to 0xFFFFFFFF as shown in man(3) rtnetlink? Looks like another reason to merge this with hyper_set_interface_name().
src/parse.c
Outdated
| dbg_pr(stdout, "net mask is %s\n", ipaddr_oldf->mask); | ||
| } else if (json_token_streq(json, &toks[i], "mtu")) { | ||
| iface->mtu = (json_token_int(json, &toks[++i])); | ||
| fprintf(stdout, "mtu is %d\n", iface->mtu); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use dbg_pr to replace fprintf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats the convention? should the fprintfs to stderr added in net.c also be replaced by dbg_pr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
travis-ci doesn't display too much outputs in job log page, we want to reduce the logs of hyperstart.
stderr case is ok. dbg_pr is only used for debug message.
Thanks!
849e05c to
37dc1eb
Compare
Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
|
LGTM, thanks! |
The mtu field is optional.