From: Thomas Graf <tgraf@suug.ch>
To: Teemu Koponen <tkoponen@iki.fi>
Cc: netdev@oss.sgi.com
Subject: Re: New address announcements in RTMGRP_IPV4_IFADDR netlink group
Date: Mon, 6 Jun 2005 21:54:22 +0200 [thread overview]
Message-ID: <20050606195422.GJ15391@postel.suug.ch> (raw)
In-Reply-To: <aa027950f2fc7f2ad640cac4a11fbe93@iki.fi>
* Teemu Koponen <aa027950f2fc7f2ad640cac4a11fbe93@iki.fi> 2005-06-06 11:59
> 0) A userspace daemon process is running and listening to the broadcast
> group.
>
> 1) Address is inserted to an interface (ip addr add ... at shell).
>
> 2) The daemon receives a NEWADDR message, just as is should, but the
> daemon is unable to bind to the address *immediately* (actually in the
> function that processes the netlink message). The result is "cannot
> assign an address" from the bind call. However, if I do insert a single
> nanosleep, even with an arbitrary low sleep value, before the bind
> call, the bind then succeeds.
>
> So, what is the semantics of NEWADDR? Should the address be bindable
> right after receiving the message?
The bind() call doesn't fail because of the address being non-existant,
it fails because the route has not been created for it. The netlink
message is generated before we notify the other subsystems about the
addition of a new address so you try to bind to an adress for which
no route has been generated yet. The best solution is probably to wait
for the route addition notification message being received and then
bind to that address.
prev parent reply other threads:[~2005-06-06 19:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-06 18:59 New address announcements in RTMGRP_IPV4_IFADDR netlink group Teemu Koponen
2005-06-06 19:54 ` Thomas Graf [this message]
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=20050606195422.GJ15391@postel.suug.ch \
--to=tgraf@suug.ch \
--cc=netdev@oss.sgi.com \
--cc=tkoponen@iki.fi \
/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