if (ctl->server.envelope == (char *)NULL)
ctl->server.envelope = "X-Envelope-To:";
-#ifdef linux
- /* interface_parse() does its own error logging */
- interface_parse(&ctl->server);
-#endif /* linux */
-
/* sanity checks */
if (ctl->server.port < 0)
{
int prc_parse_file(const char *);
int prc_filecheck(const char *);
-void interface_parse(struct hostdata *);
+void interface_parse(char *, struct hostdata *);
void interface_note_activity(struct hostdata *);
int interface_approve(struct hostdata *);
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, '/')))
| ENVELOPE STRING {current.server.envelope = xstrdup($2);}
| INTERFACE STRING {
#ifdef linux
- current.server.interface = xstrdup($2);
+ interface_parse($2, ¤t.server);
#else
fprintf(stderr, "fetchmail: interface option is only supported under Linux\n");
#endif /* linux */
#ifdef linux
FLAG_FORCE(server.interface);
FLAG_FORCE(server.monitor);
+ FLAG_FORCE(server.interface_pair);
#endif /* linux */
FLAG_FORCE(remotename);
#ifdef linux
FLAG_MERGE(server.interface);
FLAG_MERGE(server.monitor);
+ FLAG_MERGE(server.interface_pair);
#endif /* linux */
FLAG_MERGE(remotename);