summaryrefslogtreecommitdiff
path: root/src/libfast/smtp.c
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2013-01-02 14:18:20 +0100
committerYves-Alexis Perez <corsac@debian.org>2013-01-02 14:18:20 +0100
commitc1343b3278cdf99533b7902744d15969f9d6fdc1 (patch)
treed5ed3dc5677a59260ec41cd39bb284d3e94c91b3 /src/libfast/smtp.c
parentb34738ed08c2227300d554b139e2495ca5da97d6 (diff)
downloadvyos-strongswan-c1343b3278cdf99533b7902744d15969f9d6fdc1.tar.gz
vyos-strongswan-c1343b3278cdf99533b7902744d15969f9d6fdc1.zip
Imported Upstream version 5.0.1
Diffstat (limited to 'src/libfast/smtp.c')
-rw-r--r--src/libfast/smtp.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/libfast/smtp.c b/src/libfast/smtp.c
index 4118c74a6..1375c2944 100644
--- a/src/libfast/smtp.c
+++ b/src/libfast/smtp.c
@@ -136,7 +136,13 @@ METHOD(smtp_t, destroy, void,
smtp_t *smtp_create()
{
private_smtp_t *this;
- struct sockaddr_in addr;
+ struct sockaddr_in addr = {
+ .sin_family = AF_INET,
+ .sin_port = htons(25),
+ .sin_addr = {
+ .s_addr = htonl(INADDR_LOOPBACK),
+ },
+ };
int s;
INIT(this,
@@ -153,9 +159,6 @@ smtp_t *smtp_create()
free(this);
return NULL;
}
- addr.sin_family = AF_INET;
- addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
- addr.sin_port = htons(25);
if (connect(s, (struct sockaddr*)&addr, sizeof(addr)) < 0)
{
DBG1(DBG_LIB, "connecting to SMTP server failed: %s", strerror(errno));