On 2016-02-22, Lambrecht Jürgen <[email protected]> wrote:
> On 02/19/2016 07:11 PM, Grant Edwards wrote:
>> On 2016-02-19, Grant Edwards <[email protected]> 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