This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Does FreeBSD stack support multiple IP addresses?
- From: Grant Edwards <grant dot b dot edwards at gmail dot com>
- To: ecos-discuss at ecos dot sourceware dot org
- Date: Mon, 22 Feb 2016 15:05:34 +0000 (UTC)
- Subject: Re: Does FreeBSD stack support multiple IP addresses?
- Authentication-results: sourceware.org; auth=none
- References: <na7g8p$a83$1 at ger dot gmane dot org> <na7lte$o4d$1 at ger dot gmane dot org> <56CACBE1 dot 6040103 at televic dot com>
On 2016-02-22, Lambrecht JÃrgen <J.Lambrecht@TELEVIC.com> wrote:
> 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?
[...]
>> 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