From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86976 invoked by alias); 22 Feb 2016 08:50:46 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 86881 invoked by uid 89); 22 Feb 2016 08:50:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.8 required=5.0 tests=BAYES_50,KAM_LAZY_DOMAIN_SECURITY,LIKELY_SPAM_BODY,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=obligations, publication, belgium, Belgium X-HELO: exchange.televic.com Received: from ip2.televic.com (HELO exchange.televic.com) (81.82.194.222) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 Feb 2016 08:50:44 +0000 Received: from ip2.televic.com (Unknown_Domain [10.0.0.179]) by exchange.televic.com (Symantec Messaging Gateway) with SMTP id 51.35.04234.24CCAC65; Mon, 22 Feb 2016 09:52:18 +0100 (CET) Received: from SRV-MAIL02.TELEVIC.COM (10.0.0.179) by SRV-MAIL02.TELEVIC.com (10.0.0.179) with Microsoft SMTP Server (TLS) id 15.0.1104.5; Mon, 22 Feb 2016 09:50:41 +0100 Received: from SRV-MAIL02.TELEVIC.COM ([192.168.240.102]) by SRV-MAIL02.TELEVIC.com ([192.168.240.102]) with mapi id 15.00.1104.000; Mon, 22 Feb 2016 09:50:41 +0100 From: =?Windows-1252?Q?Lambrecht_J=FCrgen?= To: "ecos-discuss@ecos.sourceware.org" Date: Mon, 22 Feb 2016 08:50:00 -0000 Message-ID: <56CACBE1.6040103@televic.com> References: In-Reply-To: user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted Content-Type: text/plain; charset="Windows-1252" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes Subject: Re: [ECOS] Re: Does FreeBSD stack support multiple IP addresses? X-SW-Source: 2016-02/txt/msg00004.txt.bz2 On 02/19/2016 07:11 PM, Grant Edwards wrote: > On 2016-02-19, Grant Edwards wrote: > >> Can one assign multiple IP addresses (on different subnets) to a >> single interface when using the eCos FreeBSD network stack? >> >> I know modern BSD and Linux stacks all support that, but does the eCos >> implementation? > Some poking through the source doe and subsequent experimentation has > answered my question in the affirmative. > > You use SIOCAIFADDR(_IN6) instead of SIOCASIFADDR and its brethren. > I had 2 problems to assign 2 IP addresses with different netmasks: - To assign an IP address an set a netmask are 2 different ioctl calls.=20 To set the netmask, you cannot specify for which IP address you set it.=20 The code (current/src/sys/netinet/in.c) is written in such a way that=20 the netmask is set on the last IP address you added on that interface.=20 So that should be OK if you keep the correct order. - It is only possible to assign a class A/B/C netmask. CIDR netmasks are=20 not possible. I fixed current/src/sys/netinet/in.c for it, but I also=20 adapted the ioctl to combine setting IP address and netmask in 1 call=20 (so I cannot commit it back). Let me know if you want my fix. Short answer: yes it is possible. Kind regards, J=FCrgen P.S.: CIDR is possible in the freeBSD stack, it is only the ioctl in=20 current/src/sys/netinet/in.c that is the limitation --=20 J=FCrgen Lambrecht R&D Associate Mobile: +32 499 644 531 Twitter: JGRLambrecht Tel: +32 (0)51 303045 Fax: +32 (0)51 310670 http://www.televic-rail.com https://www.facebook.com/TelevicRail Televic Rail NV - Leo Bekaertlaan 1 - 8870 Izegem - Belgium Company number 0825.539.581 - RPR Kortrijk This electronic transmission is intended exclusively for the person or enti= ty to whom it is addressed and may contain confidential and/or privileged material. Any disclosure, copying, distribution or other action based upon = the information by persons or entities other than the intended recipient is prohibited. All e-mail correspondence from Televic Rail NV is only intended= for information purposes and can not result in contractual obligations. Commitm= ents under Televic Rail NV can only occur through regular exchange of letters, signed by authorized persons in accordance with publication in the Belgian Official Gazette. -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss