Whitespace cleanup in OSPF.

This commit is contained in:
Ondrej Zajicek 2014-07-19 17:28:38 +02:00
parent a7a7372aa7
commit 742029eb78
13 changed files with 104 additions and 107 deletions

View file

@ -397,7 +397,7 @@ ospf_receive_dbdes(struct ospf_packet *pkt, struct ospf_iface *ifa,
if (!(rcv_imms & DBDES_I) &&
!(rcv_imms & DBDES_MS) &&
(n->rid < p->router_id) &&
(n->rid < p->router_id) &&
(n->dds == rcv_ddseq))
{
/* I'm master! */

View file

@ -114,7 +114,7 @@ ospf_send_hello(struct ospf_iface *ifa, int kind, struct ospf_neighbor *dirn)
{
if (i == max)
{
log(L_WARN "%s: Too many neighbors on interface %s", p->p.name, ifa->ifname);
log(L_WARN "%s: Too many neighbors on interface %s", p->p.name, ifa->ifname);
break;
}
neighbors[i] = htonl(neigh->rid);

View file

@ -129,7 +129,7 @@ ospf_sk_open(struct ospf_iface *ifa)
ifa->des_routers = IPA_NONE;
if (sk_setup_broadcast(sk) < 0)
goto err;
goto err;
}
else
{
@ -137,10 +137,10 @@ ospf_sk_open(struct ospf_iface *ifa)
ifa->des_routers = ospf_is_v2(p) ? IP4_OSPF_DES_ROUTERS : IP6_OSPF_DES_ROUTERS;
if (sk_setup_multicast(sk) < 0)
goto err;
goto err;
if (sk_join_group(sk, ifa->all_routers) < 0)
goto err;
goto err;
}
}
@ -1307,4 +1307,3 @@ ospf_iface_info(struct ospf_iface *ifa)
cli_msg(-1015, "\tBackup designed router (IP): %I", ifa->bdrip);
}
}

View file

@ -631,4 +631,3 @@ ospf_receive_lsupd(struct ospf_packet *pkt, struct ospf_iface *ifa,
if ((n->state == NEIGHBOR_LOADING) && n->want_lsreq && !skip_lsreq)
ospf_send_lsreq(p, n);
}

View file

@ -753,12 +753,12 @@ ospf_sh(struct proto *P)
if (oa == ifa->oa)
{
ifano++;
WALK_LIST(n, ifa->neigh_list)
{
WALK_LIST(n, ifa->neigh_list)
{
nno++;
if (n->state == NEIGHBOR_FULL)
adjno++;
}
}
}
}
@ -779,8 +779,8 @@ ospf_sh(struct proto *P)
anet = (struct area_net *) nftmp;
if(firstfib)
{
cli_msg(-1014, "\t\tArea networks:");
firstfib = 0;
cli_msg(-1014, "\t\tArea networks:");
firstfib = 0;
}
cli_msg(-1014, "\t\t\t%1I/%u\t%s\t%s", anet->fn.prefix, anet->fn.pxlen,
anet->hidden ? "Hidden" : "Advertise", anet->active ? "Active" : "");
@ -793,8 +793,8 @@ ospf_sh(struct proto *P)
anet = (struct area_net *) nftmp;
if(firstfib)
{
cli_msg(-1014, "\t\tArea external networks:");
firstfib = 0;
cli_msg(-1014, "\t\tArea external networks:");
firstfib = 0;
}
cli_msg(-1014, "\t\t\t%1I/%u\t%s\t%s", anet->fn.prefix, anet->fn.pxlen,
anet->hidden ? "Hidden" : "Advertise", anet->active ? "Active" : "");
@ -1456,4 +1456,3 @@ struct protocol proto_ospf = {
.get_attr = ospf_get_attr,
.get_route_info = ospf_get_route_info
};

View file

@ -127,8 +127,8 @@ struct ospf_area_config
u8 translator; /* Translator role, for NSSA ABR */
u32 transint; /* Translator stability interval */
list patt_list; /* List of iface configs (struct ospf_iface_patt) */
list net_list; /* List of aggregate networks for that area */
list enet_list; /* List of aggregate external (NSSA) networks */
list net_list; /* List of aggregate networks for that area */
list enet_list; /* List of aggregate external (NSSA) networks */
list stubnet_list; /* List of stub networks added to Router LSA */
};
@ -334,7 +334,7 @@ struct ospf_iface
#define OSPF_I_OK 0 /* Everything OK */
#define OSPF_I_SK 1 /* Socket open failed */
#define OSPF_I_LL 2 /* Missing link-local address (OSPFv3) */
u8 sk_dr; /* Socket is a member of designated routers group */
u8 sk_dr; /* Socket is a member of designated routers group */
u8 marked; /* Used in OSPF reconfigure, 2 for force restart */
u16 rxbuf; /* Buffer size */
u16 tx_length; /* Soft TX packet length limit, usually MTU */

View file

@ -1200,18 +1200,18 @@ ospf_check_vlinks(struct ospf_proto *p)
{
struct ospf_iface *nhi = ospf_iface_find(p, tmp->nhs->iface);
if ((ifa->state != OSPF_IS_PTP)
if ((ifa->state != OSPF_IS_PTP)
|| (ifa->vifa != nhi)
|| !ipa_equal(ifa->vip, tmp->lb))
{
OSPF_TRACE(D_EVENTS, "Vlink peer %R found", tmp->lsa.id);
ospf_iface_sm(ifa, ISM_DOWN);
{
OSPF_TRACE(D_EVENTS, "Vlink peer %R found", tmp->lsa.id);
ospf_iface_sm(ifa, ISM_DOWN);
ifa->vifa = nhi;
ifa->addr = nhi->addr;
ifa->cost = tmp->dist;
ifa->vip = tmp->lb;
ospf_iface_sm(ifa, ISM_UP);
}
ifa->vip = tmp->lb;
ospf_iface_sm(ifa, ISM_UP);
}
else if ((ifa->state == OSPF_IS_PTP) && (ifa->cost != tmp->dist))
{
ifa->cost = tmp->dist;
@ -1222,11 +1222,11 @@ ospf_check_vlinks(struct ospf_proto *p)
}
else
{
if (ifa->state > OSPF_IS_DOWN)
{
OSPF_TRACE(D_EVENTS, "Vlink peer %R lost", ifa->vid);
if (ifa->state > OSPF_IS_DOWN)
{
OSPF_TRACE(D_EVENTS, "Vlink peer %R lost", ifa->vid);
ospf_iface_sm(ifa, ISM_DOWN);
}
}
}
}
}

View file

@ -1583,7 +1583,7 @@ prepare_prefix_net_lsa_body(struct ospf_proto *p, struct ospf_iface *ifa)
WALK_LIST(n, ifa->neigh_list)
if ((n->state == NEIGHBOR_FULL) &&
(en = ospf_hash_find(p->gr, ifa->iface_id, n->iface_id, n->rid, LSA_T_LINK)))
(en = ospf_hash_find(p->gr, ifa->iface_id, n->iface_id, n->rid, LSA_T_LINK)))
add_link_lsa(p, en->lsa_body, offset, &pxc);
lp = p->lsab;
@ -1955,7 +1955,7 @@ ospf_dump_lsa(struct top_hash_entry *he, struct proto *p)
rr = (struct ospf_lsa_rt_link *) (rt + 1);
for (i = 0; i < lsa_rt_items(&he->lsa); i++)
OSPF_TRACE(D_EVENTS, " - %1x %-1R %-1R %5u",
OSPF_TRACE(D_EVENTS, " - %1x %-1R %-1R %5u",
rr[i].type, rr[i].id, rr[i].data, rr[i].metric);
break;
@ -1964,7 +1964,7 @@ ospf_dump_lsa(struct top_hash_entry *he, struct proto *p)
rts = (u32 *) (ln + 1);
for (i = 0; i < lsa_net_items(&he->lsa); i++)
OSPF_TRACE(D_EVENTS, " - %-1R", rts[i]);
OSPF_TRACE(D_EVENTS, " - %-1R", rts[i]);
break;
default: