From 5a1dd0c605715b4324fdd08b8e1989aed8a94eb8 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 24 Jan 1997 00:37:30 +0000 Subject: Correct the interface parsing. svn path=/trunk/; revision=818 --- interface.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'interface.c') diff --git a/interface.c b/interface.c index 19bbd820..6342df7c 100644 --- a/interface.c +++ b/interface.c @@ -98,19 +98,16 @@ static int get_ifinfo(const char *ifname, ifinfo_t *ifinfo) return(result); } -void interface_parse(struct hostdata *hp) +void interface_parse(char *buf, struct hostdata *hp) /* parse 'interface' specification */ { char *cp1, *cp2; - /* if no interface specification present, all done */ - if (!hp->interface) - return; - /* find and isolate just the IP address */ - if (!(cp1 = strchr(hp->interface, '/'))) + if (!(cp1 = strchr(buf, '/'))) (void) error(PS_SYNTAX, 0, "missing IP interface address"); *cp1++ = '\000'; + hp->interface = xstrdup(buf); /* find and isolate just the netmask */ if (!(cp2 = strchr(cp1, '/'))) -- cgit v1.2.3