summaryrefslogtreecommitdiff
path: root/zebra/ipforward_proc.c
diff options
context:
space:
mode:
authorAvneesh Sachdev <avneesh@opensourcerouting.org>2012-04-09 00:25:15 -0700
committerAvneesh Sachdev <avneesh@opensourcerouting.org>2012-04-09 00:25:15 -0700
commit3cf6c2b4e43f44a977d218c96c26250654ae333e (patch)
treee017cde2015fbf3ef6c250327428d7c6152aa8f7 /zebra/ipforward_proc.c
parent01d7ff0a2166a422c56bd26f04fc22832a9e690b (diff)
parente96b312150d8e376c1ef463793d1929eca3618d5 (diff)
Merge branch 'quagga' into google-bgp-multipath
Conflicts: bgpd/bgp_route.c
Diffstat (limited to 'zebra/ipforward_proc.c')
-rw-r--r--zebra/ipforward_proc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/zebra/ipforward_proc.c b/zebra/ipforward_proc.c
index 73846137..2876eded 100644
--- a/zebra/ipforward_proc.c
+++ b/zebra/ipforward_proc.c
@@ -45,7 +45,6 @@ ipforward (void)
{
FILE *fp;
int ipforwarding = 0;
- char *pnt;
char buf[10];
fp = fopen (proc_net_snmp, "r");
@@ -59,8 +58,8 @@ ipforward (void)
/* Get ip_statistics.IpForwarding :
1 => ip forwarding enabled
2 => ip forwarding off. */
- pnt = fgets (buf, 6, fp);
- sscanf (buf, "Ip: %d", &ipforwarding);
+ if (fgets (buf, 6, fp))
+ sscanf (buf, "Ip: %d", &ipforwarding);
fclose(fp);
@@ -140,8 +139,8 @@ ipforward_ipv6 (void)
if (fp == NULL)
return -1;
- fgets (buf, 2, fp);
- sscanf (buf, "%d", &ipforwarding);
+ if (fgets (buf, 2, fp))
+ sscanf (buf, "%d", &ipforwarding);
fclose (fp);
return ipforwarding;