diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2009-12-11 01:20:53 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2009-12-11 11:06:51 +0100 |
commit | 8a70a13e7e79afa6818b10cf64d4f1ae4cf89e4b (patch) | |
tree | c674a054dd38aebc945a7a53c6f61539d70a01fc /proto/ospf/packet.c | |
parent | be2d38b7e977c1f72ed9cd52f8e3e85130c0aaa1 (diff) |
Implements protocol-specific Router ID for OSPF.
And fixes one minor bug.
Diffstat (limited to 'proto/ospf/packet.c')
-rw-r--r-- | proto/ospf/packet.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/proto/ospf/packet.c b/proto/ospf/packet.c index 94ec0109..1a02c00e 100644 --- a/proto/ospf/packet.c +++ b/proto/ospf/packet.c @@ -13,8 +13,9 @@ void ospf_pkt_fill_hdr(struct ospf_iface *ifa, void *buf, u8 h_type) { + struct proto_ospf *po = ifa->oa->po; + struct proto *p = &po->proto; struct ospf_packet *pkt; - struct proto *p = (struct proto *) (ifa->oa->po); pkt = (struct ospf_packet *) buf; @@ -22,7 +23,7 @@ ospf_pkt_fill_hdr(struct ospf_iface *ifa, void *buf, u8 h_type) pkt->type = h_type; - pkt->routerid = htonl(p->cf->global->router_id); + pkt->routerid = htonl(po->router_id); pkt->areaid = htonl(ifa->oa->areaid); #ifdef OSPFv3 @@ -345,7 +346,7 @@ ospf_rx_hook(sock * sk, int size) } #endif - if (ntohl(ps->routerid) == p->cf->global->router_id) + if (ntohl(ps->routerid) == po->router_id) { log(L_ERR "%s%I - received my own router ID!", mesg, sk->faddr); return 1; |