[Openais] Info required regarding netif_state_report parameters
Sridhar Sahukar
ssahukar at openclovis.com
Fri Aug 18 04:10:12 PDT 2006
Hello Steve,
Thanks for the reply.
I have some more concerns regarding the code related to
netif_state_report.
Please observe the below scenario:
-> When there is only one interface on the system, say eth0, and when it
is up, totem will bind to that interface, and it will set
netif_state_report to NETIF_STATE_REPORT_DOWN. When it goes down, it
will bind to loopback, and hence sets netif_state_report to
NETIF_STATE_REPORT_UP. Next time, as soon as eth0 interface comes up, it
will bind back to eth0 and resets the netif_state_report to
NETIF_STATE_REPORT_DOWN.
-> However, in case if there is an alternate interface available on the
system, say eth0:1, then,
For the first time, when it has bound to eth0, the netif_state_report
will be NETIF_STATE_REPORT_DOWN. When eth0 goes down, it will now bind
to eth0:1 instead of loopback. At this stage, the code in the lines
819-923 [as given in the below snapshot] will not get executed.
This will give raise to following inconsistencies:
Totem maintains my_id parameter in totemnet_instance as well as
totemsrp_instance. These will get in sync in the call to
totemnet_iface_change_fn on line 823.
In the above scenario, since the call to totemnet_iface_change_fn does
not get executed, there will be an inconsistency with the value of my_id
in totemsrp_instance and totemnet_instance.
Is this an expected behavior?
Regards,
Shridhar.
On Fri, 2006-08-18 at 02:59, Steven Dake wrote:
> On Thu, 2006-08-17 at 10:06 +0530, Sridhar Sahukar wrote:
> > Hello Steve,
> >
> > I need some information regarding the following code snippet in
> > totemnet.c file.
> >
> >
> > 817 if (instance->netif_bind_state == BIND_STATE_REGULAR) {
> > 818 if (instance->netif_state_report &
> > NETIF_STATE_REPORT_UP) {
> > 819 log_printf (instance->totemnet_log_level_notice,
> > 820 "The network interface [%s] is now up.\n",
> > 821 totemip_print
> > (&instance->totem_interface->boundto));
> > 822 instance->netif_state_report =
> > NETIF_STATE_REPORT_DOWN;
> > 823 instance->totemnet_iface_change_fn
> > (instance->context, &instance->my_id);
> > 824 }
> > 825 /*
> > 826 * Add a timer to check for interface going down in
> > single membership
> > 827 */
> > 828 if (instance->my_memb_entries == 1) {
> > 829 poll_timer_add (instance->totemnet_poll_handle,
> > 830 instance->totem_config->downcheck_timeout,
> > 831 (void *)instance,
> > 832 timer_function_netif_check_timeout,
> > 833 &instance->timer_netif_check_timeout);
> > 834 }
> > 835
> > 836 } else {
> > 837 if (instance->netif_state_report &
> > NETIF_STATE_REPORT_DOWN) {
> > 838 log_printf (instance->totemnet_log_level_notice,
> > 839 "The network interface is down.\n");
> > 840 instance->totemnet_iface_change_fn
> > (instance->context, &instance->my_id);
> > 841 }
> > 842 instance->netif_state_report = NETIF_STATE_REPORT_UP;
> > 843
> > 844 }
> >
> >
> >
> >
> > The above code snippet is very confusing as I dont find much comments
> > for the same. Also I dont find the usage of netif_state_report parameter
> > anywhere else in the code.
> >
>
> Yes it is a little tricky. The totem protocol in openais has the
> ability to bind to a new IP address (even on a different interface) if
> the ip address is changed. This is called "down checking" which is
> where the interface is checked to determine if it is down after some
> time interval. When I added the redundant ring code, I essentially took
> this functionality out by making the downcheck timeout parameter very
> large.
>
> The netif_state_report is used to report if the interface has changed
> states. If the interface has changed states (ie: it has been downed) it
> will be reported as down. The above code takes care of these issues.
>
> Regards
> -steve
>
> > Could you please explain me what exactly does this code do and what is
> > the purpose of the netif_state_report parameter?
> >
> > Regards,
> > Shridhar.
> >
> > _______________________________________________
> > Openais mailing list
> > Openais at lists.osdl.org
> > https://lists.osdl.org/mailman/listinfo/openais
>
More information about the Openais
mailing list