From patchwork Mon Feb 17 08:46:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Pesce X-Patchwork-Id: 1239046 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::240; helo=mail-lj1-x240.google.com; envelope-from=swupdate+bncbaabbengvhzakgqe54rn2ia@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vimar.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=rfnjhrWQ; dkim-atps=neutral Received: from mail-lj1-x240.google.com (mail-lj1-x240.google.com [IPv6:2a00:1450:4864:20::240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48Ld0821YSz9sPJ for ; Mon, 17 Feb 2020 19:47:18 +1100 (AEDT) Received: by mail-lj1-x240.google.com with SMTP id m1sf5648622lji.5 for ; Mon, 17 Feb 2020 00:47:18 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1581929234; cv=pass; d=google.com; s=arc-20160816; b=DjjX0C0Q5eVZa5oJAuxnOmMQ41g73qXXTI1KgrKRHrKgpWQcRRhd1SoHaZPpUFCy/3 lMV+yoE3SxWCPeYOxa/bthD4ht72SsH2Ppsxx2rgxl/UkYOlbJRCrmFLC60UYQGIlbMs FCd44UXeykRkxpux0N5ZF2soek5wFCPybSyu//A41biT6xrUEBja5iArdwVkcP+iZiUe Pw1D1W6cXWadC44HFxhpEQI/BiHJQAzQuTgcOlvFk0aisX2hXSylMb5jAOIMtj578jy8 3yXquh+eMqATDJZh4xXRk/NSaMC9ZM+FkzsKWygZndxVIZMcoPK96tk6+mJ1JBZ+LIv5 JxAw== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=LhwpYFqIbl/rH32oDu0N+RmljbB1DbAgGkIsQIv4Rdk=; b=wZUEy+L0I/pK8MVTxOfiBeC9WHzvztHfSrTikm/sLXGiT0cC05sHqYpbRyMvkrSGTa hLXpRPiiBF8TLV95Xu0GR3xLRwZI5Seb4muOeQmriTEFBPESlk6LUNROkQnpFMYl9eHg YFBO3QkmkbiOKdjxUHMKIqXqtB6XKXYICnuStbaPhz8/dw0+KrjKzpc7A02/p1Q+BRY6 SmtqJNsp9kZ0m41X3QvtJOFFOg5f5BeULcb5ZhnVdxXCY9oNXUtU3IqMi82CC+zv6M65 GOrW+78UU8EAfHZ/tkWVlPiM/YGmaWBMlEVKmA6vvCjyu+ukXgArQzt2/eTJXwGPlzWx X2MA== ARC-Authentication-Results: i=3; gmr-mx.google.com; dkim=pass header.i=@Vimargroup.onmicrosoft.com header.s=selector2-Vimargroup-onmicrosoft-com header.b=iQ6WZfVu; arc=pass (i=1 spf=pass spfdomain=vimar.com dkim=pass dkdomain=vimar.com dmarc=pass fromdomain=vimar.com); spf=pass (google.com: domain of luca.pesce@vimar.com designates 40.107.6.81 as permitted sender) smtp.mailfrom=Luca.Pesce@vimar.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=LhwpYFqIbl/rH32oDu0N+RmljbB1DbAgGkIsQIv4Rdk=; b=rfnjhrWQJp64DyjEagm9EFfY4QYFugJwcRuNnzpzPiz3HYNaC932na0AWOfHWZL9NE hGWCvI83PwZQLJQQokdHyUyDcOaRhC4x7ov6H1xP8HUw1+Vn9N3Lcgco0OisFwlCYSC9 2EOEGhoe202kkd+Qy86fVCi7zfoRniS7zaqA0Ga1YKOG6DZGz8+R0PYQQWARU1rnFuJ+ Dc4cAYpBzqsRmtkHb93kD/0NafwHzMXhg6izWDHeA9lKFICJcK63rloM53tEK/QE4LYG JfUj3rUauynITZWDIxC8qL80/LDpgpXuU412IdL9Zjhmy0v8IbRKtHRn/l+3ayI2j/s6 NC0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=LhwpYFqIbl/rH32oDu0N+RmljbB1DbAgGkIsQIv4Rdk=; b=mLFYtrHKSMyjKxPGIAgCOJ2/co/GHpNJH9junSlm2H6Ei1eJwFtSpoxUeOSdHJ4S7P cpmTaMkDDo/gaSJFfKvXthoB43P6g89+DipR6BhtD2auO89gyqaDf4A3TXFeAIUg5CaJ GFAHSSLlBqKJ0w/0HteuVbouK5Bf3KmbXBY1/cZnyTI/uHKorkzoVO3xhmo7ptztk9/3 HoPuQ6YCme+MeDyJLdMTGAQsogIU7hnzXarGlB8HVveckSLeetyMvUNO5UOOSG7m0Bhz wlm3H9PSZkZgJ0TEFdJu4p4dyccDNHjsJsyQfX20InpUyZNWyVbEmqFPP8dR8CENrm5o Vb1g== Sender: swupdate@googlegroups.com X-Gm-Message-State: APjAAAVDy4LbtJDORKfsrdp/dw6AE5J1drczYbxDu1PgIgV3WCs3JYdg NDrqJWoRerhE/mhqEVGnwqk= X-Google-Smtp-Source: APXvYqzwAhuDmJbRdJX8iTXIglhLdr93iCzv+9dmeeI20wpySUEaQDFuMQSLebS8zyn52TSOs9iGgg== X-Received: by 2002:ac2:46c2:: with SMTP id p2mr7275744lfo.139.1581929234034; Mon, 17 Feb 2020 00:47:14 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6512:3b2:: with SMTP id v18ls918355lfp.8.gmail; Mon, 17 Feb 2020 00:47:13 -0800 (PST) X-Received: by 2002:a19:4f46:: with SMTP id a6mr7453224lfk.143.1581929233406; Mon, 17 Feb 2020 00:47:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1581929233; cv=pass; d=google.com; s=arc-20160816; b=rNVorreKLiWc7vCik0dH6XRtHtNumLktwFBvUsoU527vwoREVAYO7PaVVcnYuFMlpq OmWMq1uYVUuKWD+eo5Ejzy1uQKDR/IKPnjEIkvMuLFBPdRoQcXr1DnbSQuUktMszuE4j lVJ6xc6dHSG0Rzs+RA2G3mfSCJPSBNu7+m+q4OC1rV1tsZTbQfqV556Xs/E1XgNPDfAB 8WutuP7rednXB7UR6j1XMeLNrNKWgKKHGn1YR2d7tqyNDdx3xW4zBPsqczTwyCkpebSa C4hCaHu5e7i5RXhojQ4PsEzBZBC5zxh51C+MCZRay6X0M68QSERKr4qrZtB+WEJRgmOK hiqg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ysLkTkXfh/EI/pT8YFZBKGh8mgFxDpcxO5gjrNG0Tu8=; b=W6dwQAnuHa4Z9FJ9l2ujUPgv4qFSlSK33tHM9+Fp9nVgQc/C7rlXaW9438hBLyVDxw yQZCRTtlBaLZ4QrzvWB6JTAGbkEMzV8T5LiH8Muhxb15ZruN3/HPExrvyvbZdER3dhxy M4LV/oazFf8GW8eBfsK9fOTrdRLZx9HaTJLoLbos+H3f1q7aztJVSsb/2pdfEXo1nwdz TgKolSfcIQT7DsXkrc6KTLikFj5RiRMbpUR0NIGUDOtVWE6Oop5zKKGvtJo9WTbOGKjH a1XaTpb2z3irY2RcAMrhX0ZuO4Y7+vdCaiR3QROPumBGAApApA3Up+lB0HX4QC+9Ns6G 8GJg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@Vimargroup.onmicrosoft.com header.s=selector2-Vimargroup-onmicrosoft-com header.b=iQ6WZfVu; arc=pass (i=1 spf=pass spfdomain=vimar.com dkim=pass dkdomain=vimar.com dmarc=pass fromdomain=vimar.com); spf=pass (google.com: domain of luca.pesce@vimar.com designates 40.107.6.81 as permitted sender) smtp.mailfrom=Luca.Pesce@vimar.com Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60081.outbound.protection.outlook.com. [40.107.6.81]) by gmr-mx.google.com with ESMTPS id a11si722650lff.0.2020.02.17.00.47.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Feb 2020 00:47:13 -0800 (PST) Received-SPF: pass (google.com: domain of luca.pesce@vimar.com designates 40.107.6.81 as permitted sender) client-ip=40.107.6.81; ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NiQyA4lSDWyNqIC5JnA3FSySj7vO4KdNNafxXZrNoOlg0k6FWGETGF02xWtIL0mY3d0+ZQwm6ESmnDsLRkm/WvSO6+/rDPzJnO6ZzYsb3oOuIXMl5prTK5u1/sS2cwfSxs1as720dL0K9XtWXf98WakfHd+3xbN6AX5wFeZ1s1UYsnRQEp/5SPPZASY7ty8mADPj0RtWqCNVPV4s8MKAgABjmR359wGA/RTiDiXWiYSGOZ8ZZljKM4fpvMEUc5fmZN3CvcqnZKAvL+2kikcmykVq4Q3H0zLQZqKX+groE+hgaww6McMIvNnVlaomf8KCb23+opZ9/kotGnAhTcB3UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ysLkTkXfh/EI/pT8YFZBKGh8mgFxDpcxO5gjrNG0Tu8=; b=d7RTrSMP0j6eyUVgAW0gkZMSWPaAy3cisC3naYldOcw6BLKny+2dSFAKM6g4cmF1LxNZsRZftRt/76uxaEzDk0ZjkwClRYsob9rAueLSKcCCZNMGiQtzU0hh4YsqE00WIYrSk3TZx1Y3BpVN0A3MIE/jxozc7HwqlKVPT0/nuCRu541m2/bB5qlVz2CSFU7kPGC469NwQcsbghQgjo4UvU+kaPJ1kZ6fyMNh68DvZQ12MtSVQEpFFAQBTS0iwIDFc9HbhlBNjEOtvoaLhYBnEj3apuruVhuSkXOYL9NblehoZPGo5vMT6mAAUBXfHKR1MRR2kV23xfDSwFq51WZtUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vimar.com; dmarc=pass action=none header.from=vimar.com; dkim=pass header.d=vimar.com; arc=none Received: from AM6PR08MB3160.eurprd08.prod.outlook.com (52.135.163.161) by AM6PR08MB4983.eurprd08.prod.outlook.com (10.255.120.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25; Mon, 17 Feb 2020 08:47:11 +0000 Received: from AM6PR08MB3160.eurprd08.prod.outlook.com ([fe80::252d:a3bc:2697:d8f1]) by AM6PR08MB3160.eurprd08.prod.outlook.com ([fe80::252d:a3bc:2697:d8f1%6]) with mapi id 15.20.2729.032; Mon, 17 Feb 2020 08:47:11 +0000 From: Luca Pesce To: swupdate@googlegroups.com Cc: Luca Pesce , Pedro Aguilar Subject: [swupdate] [PATCH] suricatta: added option to bind to interface/IP address. Date: Mon, 17 Feb 2020 09:46:57 +0100 Message-Id: <1581929217-7084-1-git-send-email-luca.pesce@vimar.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1581581030-29912-1-git-send-email-luca.pesce@vimar.com> References: <1581581030-29912-1-git-send-email-luca.pesce@vimar.com> X-ClientProxiedBy: AM0PR0102CA0035.eurprd01.prod.exchangelabs.com (2603:10a6:208:14::48) To AM6PR08MB3160.eurprd08.prod.outlook.com (2603:10a6:209:45::33) MIME-Version: 1.0 Received: from localhost.localdomain (93.62.232.162) by AM0PR0102CA0035.eurprd01.prod.exchangelabs.com (2603:10a6:208:14::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2729.22 via Frontend Transport; Mon, 17 Feb 2020 08:47:10 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [93.62.232.162] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e0236692-3fa7-420a-eb98-08d7b385fa3f X-MS-TrafficTypeDiagnostic: AM6PR08MB4983:|AM6PR08MB4983: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2399; X-Forefront-PRVS: 0316567485 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(366004)(346002)(39850400004)(376002)(396003)(199004)(189003)(66476007)(66556008)(6512007)(54906003)(36756003)(107886003)(66946007)(186003)(86362001)(26005)(16526019)(44832011)(8676002)(69590400006)(6666004)(316002)(8936002)(5660300002)(956004)(2616005)(4326008)(2906002)(6486002)(6506007)(478600001)(6916009)(81166006)(52116002)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR08MB4983; H:AM6PR08MB3160.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: vimar.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vhGExXWffXA2zxkP4rzOtPB938jxoDNThFqU6zlsS/LP55rImq+3Fe63QDE6/7hFuVBW6mCsPmlmx349Hvhmk++lijQQPLCy0NzKGegyn9nIoWcBE8fFY6NTF/75GjkleD3ZQ+QlD60uLK95ZB+jgGQQwyKnMI6KkN+2PBStxG1hcrxEaf79c8Dz/ar35UMTBG0c6oePS09DC9l2i/Bj1aXdh/37piUchEecSv1+xBGiPy1sSS6wOilpgG1ZQ9DtwCFutr1mYOSnjSosXQUzrVmu4ZjXX3x8H4tBm7K955R5cHgEM7+Md02Vj+rHPRHJT3kwPTeOhUMhwrMd6oN07604ssVcRSLvGumx4Q8DSX5TGxOhiStlnmvoNxzRHVlaJDPkKoTMjClBheXQFknKnSKqvK/LqyKJAYjWq49kPj0hf0rcBZZo7MjQm1Sm+VZcYKIq38GBhjEo7DYm2RWrIsvDTWxxrimx07zAmJ6cf8Ppc4YpwubYeCxMN5BTt6io7hF5uTFe47QIlIChdnhWsici6LMa+Z8s/fVIqo7bFyk= X-MS-Exchange-AntiSpam-MessageData: 6Ogb4XkCzgYBLBoJxzrct5NbqaPOQ6GJT6UA9D44e+jgjbNYE4DYlxtAGZngMZHy87WXQscwvwJwqxykhgLoevV+wBc3C4z733pEQzLyzn1jSz+eJ1PXuliGKSoio6G0+swTOvDJHqfi935wPYPNXA== X-OriginatorOrg: vimar.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0236692-3fa7-420a-eb98-08d7b385fa3f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Feb 2020 08:47:10.9348 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a1f008bc-d59b-4c66-8f87-60fd9af15c7f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4C2/JvpZvl1BVSIorWG5lFAf4Ua1KsJQVbeSKEPpSWuV0Uu1z9ELM3tKK7UrrBAYLL866nEpSQXDuoVU6yi8LA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4983 X-Original-Sender: luca.pesce@vimar.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@Vimargroup.onmicrosoft.com header.s=selector2-Vimargroup-onmicrosoft-com header.b=iQ6WZfVu; arc=pass (i=1 spf=pass spfdomain=vimar.com dkim=pass dkdomain=vimar.com dmarc=pass fromdomain=vimar.com); spf=pass (google.com: domain of luca.pesce@vimar.com designates 40.107.6.81 as permitted sender) smtp.mailfrom=Luca.Pesce@vimar.com Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , This patch adds the -f cmdline arg and the "interface" parameter to suricatta to optionally bind communication channel to a specific interface or IP address. To do so, a new config option is added to curl channel interface, which then exploits CURLOPT_INTERFACE option. Binding to an interface is useful in multi-interface devices, where routing can be policy-based (e.g with output traffic classification rules based on src address/device). Signed-off-by: Luca Pesce Signed-off-by: Pedro Aguilar --- corelib/channel_curl.c | 12 ++++++++++++ examples/configuration/swupdate.cfg | 3 +++ include/channel_curl.h | 1 + suricatta/common.c | 3 +++ suricatta/server_hawkbit.c | 9 +++++++-- 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/corelib/channel_curl.c b/corelib/channel_curl.c index 9062a73..c00e994 100644 --- a/corelib/channel_curl.c +++ b/corelib/channel_curl.c @@ -600,6 +600,18 @@ channel_op_res_t channel_set_options(channel_t *this, } } + /* + * If requested, use a specific interface/IP address + */ + if (channel_data->iface != NULL) { + if (curl_easy_setopt(channel_curl->handle, + CURLOPT_INTERFACE, + channel_data->iface) != CURLE_OK) { + result = CHANNEL_EINIT; + goto cleanup; + } + } + switch (method) { case CHANNEL_GET: if (curl_easy_setopt(channel_curl->handle, CURLOPT_CUSTOMREQUEST, diff --git a/examples/configuration/swupdate.cfg b/examples/configuration/swupdate.cfg index 6631436..39dda88 100644 --- a/examples/configuration/swupdate.cfg +++ b/examples/configuration/swupdate.cfg @@ -127,6 +127,9 @@ identify : ( # ciphers : string in the format used by CURL to set the allowed ciphers suite # This allows to disable some ciphers, for example # ciphers = "!eNULL:!aNULL:!EXP:!LOW:!MEDIUM:!ADH:!AECDH:!IDEA:!SEED:!MD5:!SHA:!RC4:HIGH+EECDH:HIGH+EDH"; +# interface : string +# interface name (e.g. "eth0") or IP address to bind communication channel to. +# This allows to select source interface/address for outgoing traffic, if needed. suricatta : { diff --git a/include/channel_curl.h b/include/channel_curl.h index 0e499c6..2904712 100644 --- a/include/channel_curl.h +++ b/include/channel_curl.h @@ -37,6 +37,7 @@ typedef struct { char *url; char *auth; char *request_body; + char *iface; #ifdef CONFIG_JSON json_object *json_reply; #endif diff --git a/suricatta/common.c b/suricatta/common.c index 51b7be8..bf2bcd2 100644 --- a/suricatta/common.c +++ b/suricatta/common.c @@ -42,6 +42,9 @@ void suricatta_channel_settings(void *elem, channel_data_t *chan) GET_FIELD_STRING_RESET(LIBCFG_PARSER, elem, "proxy", tmp); if (strlen(tmp)) SETSTRING(chan->proxy, tmp); + GET_FIELD_STRING_RESET(LIBCFG_PARSER, elem, "interface", tmp); + if (strlen(tmp)) + SETSTRING(chan->iface, tmp); } server_op_res_t map_channel_retcode(channel_op_res_t response) diff --git a/suricatta/server_hawkbit.c b/suricatta/server_hawkbit.c index fc5d932..55f1431 100644 --- a/suricatta/server_hawkbit.c +++ b/suricatta/server_hawkbit.c @@ -46,6 +46,7 @@ static struct option long_options[] = { {"proxy", optional_argument, NULL, 'y'}, {"targettoken", required_argument, NULL, 'k'}, {"gatewaytoken", required_argument, NULL, 'g'}, + {"interface", required_argument, NULL, 'f'}, {NULL, 0, NULL, 0}}; static unsigned short mandatory_argument_count = 0; @@ -1443,7 +1444,8 @@ void server_print_help(void) "\t -y, --proxy Use proxy. Either give proxy URL, else " "{http,all}_proxy env is tried.\n" "\t -k, --targettoken Set target token.\n" - "\t -g, --gatewaytoken Set gateway token.\n", + "\t -g, --gatewaytoken Set gateway token.\n" + "\t -f, --interface Set the network interface to connect to Hawkbit.\n", CHANNEL_DEFAULT_POLLING_INTERVAL, CHANNEL_DEFAULT_RESUME_TRIES, CHANNEL_DEFAULT_RESUME_DELAY); } @@ -1519,7 +1521,7 @@ server_op_res_t server_start(char *fname, int argc, char *argv[]) /* reset to optind=1 to parse suricatta's argument vector */ optind = 1; opterr = 0; - while ((choice = getopt_long(argc, argv, "t:i:c:u:p:xr:y::w:k:g:", + while ((choice = getopt_long(argc, argv, "t:i:c:u:p:xr:y::w:k:g:f:", long_options, NULL)) != -1) { switch (choice) { case 't': @@ -1595,6 +1597,9 @@ server_op_res_t server_start(char *fname, int argc, char *argv[]) channel_data_defaults.retry_sleep = (unsigned int)strtoul(optarg, NULL, 10); break; + case 'f': + SETSTRING(channel_data_defaults.iface, optarg); + break; /* Ignore not recognized options, they can be already parsed by the caller */ case '?': break;