diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2012-11-15 14:08:20 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2012-11-15 14:08:20 +0100 |
commit | 6cadbf325bfcf25a04d869778abb443f9e1b6119 (patch) | |
tree | 80dd5be03c3a2c0fc749e2f523f4e98f4ad8a78c | |
parent | 15550957957f3c790f3bec3f6b8721559ea25969 (diff) |
Change unnamed ptp link description on OSPFv2.
Although it is a slight deviation from the standard, it has no ill
consequences for OSPFv2 and the change fixes a compatibility issue
with some broken implementations.
-rw-r--r-- | proto/ospf/topology.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/proto/ospf/topology.c b/proto/ospf/topology.c index bfa071d8..5f4d1d54 100644 --- a/proto/ospf/topology.c +++ b/proto/ospf/topology.c @@ -258,8 +258,17 @@ originate_rt_lsa_body(struct ospf_area *oa, u16 *length) ln = lsab_alloc(po, sizeof(struct ospf_lsa_rt_link)); ln->type = LSART_PTP; ln->id = neigh->rid; - ln->data = (ifa->addr->flags & IA_PEER) ? - ifa->iface_id : ipa_to_u32(ifa->addr->ip); + + /* + * ln->data should be ifa->iface_id in case of no/ptp + * address (ifa->addr->flags & IA_PEER) on PTP link (see + * RFC 2328 12.4.1.1.), but the iface ID value has no use, + * while using IP address even in this case is here for + * compatibility with some broken implementations that use + * this address as a next-hop. + */ + ln->data = ipa_to_u32(ifa->addr->ip); + ln->metric = ifa->cost; ln->padding = 0; i++; |