From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89730 invoked by alias); 22 Feb 2016 15:05:48 -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 89715 invoked by uid 89); 22 Feb 2016 15:05:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=examination, nude, SIOCASIFADDR, _IN6 X-HELO: plane.gmane.org Received: from plane.gmane.org (HELO plane.gmane.org) (80.91.229.3) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 22 Feb 2016 15:05:45 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aXs3R-0007ii-5s for ecos-discuss@ecos.sourceware.org; Mon, 22 Feb 2016 16:05:41 +0100 Received: from 67-130-15-94.dia.static.qwest.net ([67.130.15.94]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 22 Feb 2016 16:05:41 +0100 Received: from grant.b.edwards by 67-130-15-94.dia.static.qwest.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 22 Feb 2016 16:05:41 +0100 To: ecos-discuss@ecos.sourceware.org From: Grant Edwards Date: Mon, 22 Feb 2016 15:05:00 -0000 Message-ID: References: <56CACBE1.6040103@televic.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit User-Agent: slrn/1.0.2 (Linux) X-IsSubscribed: yes Subject: [ECOS] Re: Does FreeBSD stack support multiple IP addresses? X-SW-Source: 2016-02/txt/msg00005.txt.bz2 On 2016-02-22, Lambrecht Jürgen wrote: > 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? [...] >> 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. To set the netmask, you cannot specify for which IP > address you set it. The code (current/src/sys/netinet/in.c) is > written in such a way that the netmask is set on the last IP > address you added on that interface. So that should be OK if you > keep the correct order. When I tried it, the SIOCAIFADDR ioctl() let me set both address and netmask in a single call. The "case SIOCAIFADDR" code falls through into SIOCSIFNETMASK code. That didn't work for you? > - It is only possible to assign a class A/B/C netmask. CIDR netmasks are > not possible. I think that's always been the case for this version of the stack, hasn't it? > I fixed current/src/sys/netinet/in.c for it, but I also > adapted the ioctl to combine setting IP address and netmask in 1 call > (so I cannot commit it back). Let me know if you want my fix. I'm confused: based on my experiments and examination of the source code, it already works that way. -- Grant Edwards grant.b.edwards Yow! Psychoanalysis?? at I thought this was a nude gmail.com rap session!!! -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss