Re: [mpls-linux-general] Ping Problem
Status: Beta
Brought to you by:
jleu
|
From: Ramon C. <cas...@in...> - 2004-03-26 20:37:56
|
On Fri, 26 Mar 2004, James R. Leu wrote:
> I wonder if he found a bug. It seems to be triggered when he issues
> an "ILM" add before setting the labelspace. In the code we create the
I think that the case where the labelspace was changed without being reset
(something that I did not happen to test) was not considered.
What about:
static int
__mpls_set_labelspace (struct net_device *dev, int labelspace)
{
struct mpls_interface *mpls_ptr = NULL;
MPLS_ENTER;
if (!dev->mpls_ptr) {
if (labelspace != -1) {
mpls_ptr = mpls_create_if_info ();
if (unlikely(!mpls_ptr)) {
MPLS_DEBUG("Set labelspace for %s to %d
failed\n",
dev->name, labelspace);
MPLS_EXIT;
return -ENOMEM;
}
/* Actual assignment happens here */
mpls_ptr->labelspace = labelspace;
dev->mpls_ptr = (void*)mpls_ptr;
MPLS_DEBUG("Set labelspace for %s to %d\n",
dev->name, labelspace);
}
} else {
if (labelspace == -1) {
MPLS_DEBUG("Resetting labelspace for %s to %d\n",
dev->name,-1);
mpls_delete_if_info (dev->mpls_ptr);
dev->mpls_ptr = NULL;
} else {
dev->mpls_ptr->labelspace = labelspace;
}
}
MPLS_EXIT;
return 0;
}
(not comitted in p4 yet) although I am not convinced that this was the
cause of Josef's problems....
Comments?
R.
|