summaryrefslogtreecommitdiff
path: root/ip/iprule.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2016-03-22 19:35:15 +0100
committerStephen Hemminger <stephen@networkplumber.org>2016-03-27 10:37:34 -0700
commita418e451643e77fe36861e53359587ba8aa41873 (patch)
tree11b733b2f472eb1b337ec1dc6dba9290e13dc250 /ip/iprule.c
parentff9d8f3728aff0115aa672280d06c0907eb35bbe (diff)
make format_host non-reentrant by default
There are only three users which require it to be reentrant, the rest is fine without. Instead, provide a reentrant format_host_r() for users which need it. Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'ip/iprule.c')
-rw-r--r--ip/iprule.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/ip/iprule.c b/ip/iprule.c
index dc45c6b4..345b3b04 100644
--- a/ip/iprule.c
+++ b/ip/iprule.c
@@ -94,8 +94,7 @@ int print_rule(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
} else {
fprintf(fp, "from %s ", format_host(r->rtm_family,
RTA_PAYLOAD(tb[FRA_SRC]),
- RTA_DATA(tb[FRA_SRC]),
- abuf, sizeof(abuf))
+ RTA_DATA(tb[FRA_SRC]))
);
}
} else if (r->rtm_src_len) {
@@ -115,8 +114,7 @@ int print_rule(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
} else {
fprintf(fp, "to %s ", format_host(r->rtm_family,
RTA_PAYLOAD(tb[FRA_DST]),
- RTA_DATA(tb[FRA_DST]),
- abuf, sizeof(abuf)));
+ RTA_DATA(tb[FRA_DST])));
}
} else if (r->rtm_dst_len) {
fprintf(fp, "to 0/%d ", r->rtm_dst_len);
@@ -191,8 +189,7 @@ int print_rule(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
fprintf(fp, "map-to %s ",
format_host(r->rtm_family,
RTA_PAYLOAD(tb[RTA_GATEWAY]),
- RTA_DATA(tb[RTA_GATEWAY]),
- abuf, sizeof(abuf)));
+ RTA_DATA(tb[RTA_GATEWAY])));
} else
fprintf(fp, "masquerade");
} else if (r->rtm_type == FR_ACT_GOTO) {