diff options
author | Ondrej Filip <feela@network.cz> | 2004-06-04 20:51:29 +0200 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 2004-06-04 20:51:29 +0200 |
commit | e7ef86a58cc5393ba764606b0ee6d760e6164f0c (patch) | |
tree | 19fab1206527558cbfc7fac11945ce477757c251 /proto | |
parent | f158bb710b8be65b626f54399c8a5db8df9bd7b6 (diff) | |
download | bird-e7ef86a58cc5393ba764606b0ee6d760e6164f0c.tar bird-e7ef86a58cc5393ba764606b0ee6d760e6164f0c.zip |
OSPF is ready for changing MTU.
Diffstat (limited to 'proto')
-rw-r--r-- | proto/ospf/dbdes.c | 6 | ||||
-rw-r--r-- | proto/ospf/iface.c | 17 | ||||
-rw-r--r-- | proto/ospf/neighbor.c | 2 |
3 files changed, 23 insertions, 2 deletions
diff --git a/proto/ospf/dbdes.c b/proto/ospf/dbdes.c index f591955..3cc263c 100644 --- a/proto/ospf/dbdes.c +++ b/proto/ospf/dbdes.c @@ -119,6 +119,12 @@ ospf_dbdes_send(struct ospf_neighbor *n) case NEIGHBOR_FULL: length = ntohs(((struct ospf_packet *)n)->length); + if(!length) + { + OSPF_TRACE(D_PACKETS, "No packet in my buffer for repeating"); + ospf_neigh_sm(n, INM_KILLNBR); + } + memcpy(ifa->ip_sk->tbuf, n->ldbdes, length); /* Copy last sent packet again */ diff --git a/proto/ospf/iface.c b/proto/ospf/iface.c index 30eb40b..d08fa8b 100644 --- a/proto/ospf/iface.c +++ b/proto/ospf/iface.c @@ -430,8 +430,23 @@ ospf_if_notify(struct proto *p, unsigned flags, struct iface *iface) { if((ifa=find_iface((struct proto_ospf *)p, iface))!=NULL) { + struct ospf_packet *op; + struct ospf_neighbor *n; OSPF_TRACE(D_EVENTS, "Changing MTU on interface %s.", iface->name); - /* FIXME: change MTU */ + sk_reallocate(ifa->hello_sk); + sk_reallocate(ifa->dr_sk); + sk_reallocate(ifa->ip_sk); + + WALK_LIST(n,ifa->neigh_list) + { + op = (struct ospf_packet *)n->ldbdes; + n->ldbdes = mb_allocz(n->pool, iface->mtu); + + if(ntohs(op->length) <= iface->mtu) /* If the packet in old buffer is bigger, let it filled by zeros */ + memcpy(n->ldbdes, op, iface->mtu); /* If the packet is old is same or smaller, copy it */ + + rfree(op); + } } } } diff --git a/proto/ospf/neighbor.c b/proto/ospf/neighbor.c index 6ba3282..a45ed2d 100644 --- a/proto/ospf/neighbor.c +++ b/proto/ospf/neighbor.c @@ -38,7 +38,7 @@ ospf_neighbor_new(struct ospf_iface *ifa) n->ifa = ifa; add_tail(&ifa->neigh_list, NODE n); n->adj = 0; - n->ldbdes=mb_alloc(pool, ifa->iface->mtu); + n->ldbdes=mb_allocz(pool, ifa->iface->mtu); n->state=NEIGHBOR_DOWN; n->inactim = tm_new(pool); |