summaryrefslogtreecommitdiffstats
path: root/ospfclient
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-06-13 19:10:32 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-06-13 19:10:32 +0200
commite6fda497d36365ef9b5adcbb9f59c397d0c7f5c5 (patch)
treeb07d9bd58b55ef5b9268d75e3127827573181be0 /ospfclient
parentMerge branch 'stable/3.0' (diff)
downloadfrr-e6fda497d36365ef9b5adcbb9f59c397d0c7f5c5.tar.xz
frr-e6fda497d36365ef9b5adcbb9f59c397d0c7f5c5.zip
*: Clean up call into inet_aton
In the few places where we were not checking the return code for inet_aton, do so. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'ospfclient')
-rw-r--r--ospfclient/ospfclient.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/ospfclient/ospfclient.c b/ospfclient/ospfclient.c
index 195fd5b5a..d8d0fe8d4 100644
--- a/ospfclient/ospfclient.c
+++ b/ospfclient/ospfclient.c
@@ -94,7 +94,12 @@ lsa_delete (struct thread *t)
oclient = THREAD_ARG (t);
- inet_aton (args[6], &area_id);
+ rc = inet_aton (args[6], &area_id);
+ if (rc <= 0)
+ {
+ printf("Address Specified: %s is invalid\n", args[6]);
+ return rc;
+ }
printf ("Deleting LSA... ");
rc = ospf_apiclient_lsa_delete (oclient,
@@ -123,8 +128,19 @@ lsa_inject (struct thread *t)
cl = THREAD_ARG (t);
- inet_aton (args[5], &ifaddr);
- inet_aton (args[6], &area_id);
+ rc = inet_aton (args[5], &ifaddr);
+ if (rc <= 0)
+ {
+ printf ("Ifaddr specified %s is invalid\n", args[5]);
+ return rc;
+ }
+
+ rc = inet_aton (args[6], &area_id);
+ if (rc <= 0)
+ {
+ printf( "Area ID specified %s is invalid\n", args[6]);
+ return rc;
+ }
lsa_type = atoi (args[2]);
opaque_type = atoi (args[3]);
opaque_id = atoi (args[4]);