aboutsummaryrefslogtreecommitdiffstats
path: root/ip/tcp_metrics.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemming@brocade.com>2015-05-27 12:26:14 -0700
committerStephen Hemminger <shemming@brocade.com>2015-05-27 13:00:21 -0700
commitc079e121a73af5eb49e003b13607e8a690331df6 (patch)
tree2815b765d9f112cb473218680559315603781525 /ip/tcp_metrics.c
parentbde5baa5476cd8d7d33afc42170dc984f3717e14 (diff)
downloadplatform_external_iproute2-c079e121a73af5eb49e003b13607e8a690331df6.tar.gz
platform_external_iproute2-c079e121a73af5eb49e003b13607e8a690331df6.tar.bz2
platform_external_iproute2-c079e121a73af5eb49e003b13607e8a690331df6.zip
libnetlink: add size argument to rtnl_talk
There have been several instances where response from kernel has overrun the stack buffer from the caller. Avoid future problems by passing a size argument. Also drop the unused peer and group arguments to rtnl_talk.
Diffstat (limited to 'ip/tcp_metrics.c')
-rw-r--r--ip/tcp_metrics.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ip/tcp_metrics.c b/ip/tcp_metrics.c
index bbbb4cc0..bdc503ef 100644
--- a/ip/tcp_metrics.c
+++ b/ip/tcp_metrics.c
@@ -467,10 +467,10 @@ static int tcpm_do_cmd(int cmd, int argc, char **argv)
}
if (ack) {
- if (rtnl_talk(&grth, &req.n, 0, 0, NULL) < 0)
+ if (rtnl_talk(&grth, &req.n, NULL, 0) < 0)
return -2;
} else if (atype >= 0) {
- if (rtnl_talk(&grth, &req.n, 0, 0, &req.n) < 0)
+ if (rtnl_talk(&grth, &req.n, &req.n, sizeof(req)) < 0)
return -2;
if (process_msg(NULL, &req.n, stdout) < 0) {
fprintf(stderr, "Dump terminated\n");