summaryrefslogtreecommitdiff
path: root/nhrpd/linux.c
diff options
context:
space:
mode:
Diffstat (limited to 'nhrpd/linux.c')
-rw-r--r--nhrpd/linux.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/nhrpd/linux.c b/nhrpd/linux.c
index 85e941e7ba..59c82b1c55 100644
--- a/nhrpd/linux.c
+++ b/nhrpd/linux.c
@@ -25,6 +25,7 @@
#include <linux/ip.h>
#include <linux/if_arp.h>
#include <linux/if_tunnel.h>
+#include <linux/limits.h>
#include "nhrp_protocol.h"
#include "os.h"
@@ -127,10 +128,11 @@ static int linux_configure_arp(const char *iface, int on)
static int linux_icmp_redirect_off(const char *iface)
{
- char fname[256];
+ char fname[PATH_MAX];
int fd, ret = -1;
- sprintf(fname, "/proc/sys/net/ipv4/conf/%s/send_redirects", iface);
+ snprintf(fname, sizeof(fname),
+ "/proc/sys/net/ipv4/conf/%s/send_redirects", iface);
fd = open(fname, O_WRONLY);
if (fd < 0)
return -1;