forked from Mirror/frr
Add comment questioning part of previous change (Denis?).
Fix indentation to match accumulated changes.
This commit is contained in:
parent
f76594a2e3
commit
dfdb8f18c0
|
@ -96,6 +96,11 @@ kernel_rtm_ipv4 (int cmd, struct prefix *p, struct rib *rib, int family)
|
||||||
{
|
{
|
||||||
gate = 0;
|
gate = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XXX We need to refrain from kernel operations in some cases,
|
||||||
|
* but this if statement seems overly cautious - what about
|
||||||
|
* other than ADD and DELETE?
|
||||||
|
*/
|
||||||
if ((cmd == RTM_ADD
|
if ((cmd == RTM_ADD
|
||||||
&& CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE))
|
&& CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE))
|
||||||
|| (cmd == RTM_DELETE
|
|| (cmd == RTM_DELETE
|
||||||
|
@ -127,14 +132,14 @@ kernel_rtm_ipv4 (int cmd, struct prefix *p, struct rib *rib, int family)
|
||||||
|| nexthop->type == NEXTHOP_TYPE_IFNAME
|
|| nexthop->type == NEXTHOP_TYPE_IFNAME
|
||||||
|| nexthop->type == NEXTHOP_TYPE_IPV4_IFINDEX)
|
|| nexthop->type == NEXTHOP_TYPE_IPV4_IFINDEX)
|
||||||
ifindex = nexthop->ifindex;
|
ifindex = nexthop->ifindex;
|
||||||
if (nexthop->type == NEXTHOP_TYPE_BLACKHOLE)
|
if (nexthop->type == NEXTHOP_TYPE_BLACKHOLE)
|
||||||
{
|
{
|
||||||
struct in_addr loopback;
|
struct in_addr loopback;
|
||||||
loopback.s_addr = htonl (INADDR_LOOPBACK);
|
loopback.s_addr = htonl (INADDR_LOOPBACK);
|
||||||
sin_gate.sin_addr = loopback;
|
sin_gate.sin_addr = loopback;
|
||||||
gate = 1;
|
gate = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gate && p->prefixlen == 32)
|
if (gate && p->prefixlen == 32)
|
||||||
mask = NULL;
|
mask = NULL;
|
||||||
|
@ -148,27 +153,27 @@ kernel_rtm_ipv4 (int cmd, struct prefix *p, struct rib *rib, int family)
|
||||||
mask = &sin_mask;
|
mask = &sin_mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
error = rtm_write (cmd,
|
error = rtm_write (cmd,
|
||||||
(union sockunion *)&sin_dest,
|
(union sockunion *)&sin_dest,
|
||||||
(union sockunion *)mask,
|
(union sockunion *)mask,
|
||||||
gate ? (union sockunion *)&sin_gate : NULL,
|
gate ? (union sockunion *)&sin_gate : NULL,
|
||||||
ifindex,
|
ifindex,
|
||||||
rib->flags,
|
rib->flags,
|
||||||
rib->metric);
|
rib->metric);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
zlog_info ("kernel_rtm_ipv4(): nexthop %d add error=%d.",
|
zlog_info ("kernel_rtm_ipv4(): nexthop %d add error=%d.",
|
||||||
nexthop_num, error);
|
nexthop_num, error);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (error == 0)
|
if (error == 0)
|
||||||
{
|
{
|
||||||
nexthop_num++;
|
nexthop_num++;
|
||||||
if (cmd == RTM_ADD)
|
if (cmd == RTM_ADD)
|
||||||
SET_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB);
|
SET_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue