public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "Lambrecht Jürgen" <J.Lambrecht@TELEVIC.com>
To: "ecos-discuss@ecos.sourceware.org" <ecos-discuss@ecos.sourceware.org>
Subject: Re: [ECOS] Re: Does FreeBSD stack support multiple IP addresses?
Date: Mon, 22 Feb 2016 08:50:00 -0000	[thread overview]
Message-ID: <56CACBE1.6040103@televic.com> (raw)
In-Reply-To: <na7lte$o4d$1@ger.gmane.org>

On 02/19/2016 07:11 PM, Grant Edwards wrote:
> On 2016-02-19, Grant Edwards <grant.b.edwards@gmail.com> 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. 
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.
- It is only possible to assign a class A/B/C netmask. CIDR netmasks are 
not possible. 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.

Short answer: yes it is possible.

Kind regards,
Jürgen

P.S.: CIDR is possible in the freeBSD stack, it is only the ioctl in 
current/src/sys/netinet/in.c that is the limitation

-- 
Jürgen 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 entity
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. Commitments
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

  reply	other threads:[~2016-02-22  8:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-19 16:35 [ECOS] " Grant Edwards
2016-02-19 18:12 ` [ECOS] " Grant Edwards
2016-02-22  8:50   ` Lambrecht Jürgen [this message]
2016-02-22 15:05     ` Grant Edwards
2016-02-23  8:09       ` Lambrecht Jürgen
2016-02-23 15:59         ` Grant Edwards
     [not found]           ` <DUB109-W90FA10A08EE609DF0BB91393A50@phx.gbl>
2016-02-24 16:47             ` Grant Edwards
2016-03-15 11:10           ` Lambrecht Jürgen
2016-03-15 14:56             ` Grant Edwards

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56CACBE1.6040103@televic.com \
    --to=j.lambrecht@televic.com \
    --cc=ecos-discuss@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).