public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: cyl cyl <cylecos@gmail.com>
To: eCos Users <ecos-discuss@ecos.sourceware.org>
Subject: [ECOS] Re: ipv6 question
Date: Mon, 31 Dec 2012 05:06:00 -0000	[thread overview]
Message-ID: <CAFOmwhqtQt+JtG9btP6KOaO_XAMF_ek1kTDNnW8FAS3uQgMk6w@mail.gmail.com> (raw)
In-Reply-To: <CAFOmwhqnWq+2YtMx1cMjC+gFO9sGkCYJnaixw8kJt_kKLtoH8g@mail.gmail.com>

I found it. If the ip I set is a linklocal ip (fe80) , then
s6_adr16[1] will change to ifp->if_index.

	if (sa6 && sa6->sin6_family == AF_INET6) {
		if (IN6_IS_ADDR_LINKLOCAL(&sa6->sin6_addr)) {
			if (sa6->sin6_addr.s6_addr16[1] == 0) {
				/* link ID is not embedded by the user */
				sa6->sin6_addr.s6_addr16[1] =
					htons(ifp->if_index);
			} else if (sa6->sin6_addr.s6_addr16[1] !=
				    htons(ifp->if_index)) {
				return(EINVAL);	/* link ID contradicts */
			}

So I set another IP (3ffe .....) ,and it works OK.

2012/12/24 cyl cyl <cylecos@gmail.com>:
> Hello:
>
>         In function init_net_IPv6, I set "fe80::219:dbff:fea9:f3d5"
> for my eth0 ipv6 address. But _show_all_interfaces says my ip is
> "fe80:1::219:dbff:fea9:f3d5". I don't know why it adds a "1" in it.
>         The prefix I set is "fe80:0:0:0" .
>
>
> ipv6: fe80::219:dbff:fea9:f3d5, in6mask64: ff ff ff ff ff ff ff ff
>
> 0xa0b53204 - eth0 - 192.168.1.239
> 0xa0b53220 - eth0 - fe80:1::200:ff:fe6c:18f0
> 0xa0b5323c - eth0 - fe80:1::219:dbff:fea9:f3d5
> 0xa0b53274 - lo0 - ::1
> 0xa0b53290 can_send: 1

-- 
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:[~2012-12-31  5:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-24  6:51 [ECOS] " cyl cyl
2012-12-31  5:06 ` cyl cyl [this message]
2013-01-05  3:45   ` [ECOS] " cyl cyl
2013-01-05  8:20     ` cyl cyl
2013-01-06  4:19       ` cyl cyl

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=CAFOmwhqtQt+JtG9btP6KOaO_XAMF_ek1kTDNnW8FAS3uQgMk6w@mail.gmail.com \
    --to=cylecos@gmail.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).