summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-04-18 19:31:42 +0000
committerOndrej Filip <feela@network.cz>2000-04-18 19:31:42 +0000
commit9eea604769662479891020b5a0fb282faa6dc36f (patch)
treeeb9f2d3e74029fb0987e2d38b5f4ee098dd1b0f2
parent79f036ef6e9b2204528a41079c59a3a9ae9d50f5 (diff)
Multicast open socket for (B)DR bugfix.
-rw-r--r--proto/ospf/iface.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/proto/ospf/iface.c b/proto/ospf/iface.c
index d76aaae7..47ab8dcb 100644
--- a/proto/ospf/iface.c
+++ b/proto/ospf/iface.c
@@ -31,20 +31,25 @@ iface_chstate(struct ospf_iface *ifa, u8 state)
{
if(ifa->dr_sk==NULL)
{
+ DBG("%s: Adding new multicast socket for (B)DR\n", p->name);
ifa->dr_sk=sk_new(p->pool);
- ifa->dr_sk->type=SK_IP_MC;
- ifa->dr_sk->saddr=AllDRouters;
- ifa->dr_sk->daddr=AllDRouters;
- ifa->dr_sk->tos=IP_PREC_INTERNET_CONTROL;
- ifa->dr_sk->ttl=1;
- ifa->dr_sk->rx_hook=ospf_rx_hook;
- ifa->dr_sk->tx_hook=ospf_tx_hook;
- ifa->dr_sk->err_hook=ospf_err_hook;
- ifa->dr_sk->iface=ifa->iface;
- ifa->dr_sk->rbsize=ifa->iface->mtu;
- ifa->dr_sk->tbsize=ifa->iface->mtu;
- ifa->dr_sk->data=(void *)ifa;
- sk_open(ifa->dr_sk);
+ ifa->dr_sk->type=SK_IP_MC;
+ ifa->dr_sk->dport=OSPF_PROTO;
+ ifa->dr_sk->saddr=AllDRouters;
+ ifa->dr_sk->daddr=AllDRouters;
+ ifa->dr_sk->tos=IP_PREC_INTERNET_CONTROL;
+ ifa->dr_sk->ttl=1;
+ ifa->dr_sk->rx_hook=ospf_rx_hook;
+ ifa->dr_sk->tx_hook=ospf_tx_hook;
+ ifa->dr_sk->err_hook=ospf_err_hook;
+ ifa->dr_sk->iface=ifa->iface;
+ ifa->dr_sk->rbsize=ifa->iface->mtu;
+ ifa->dr_sk->tbsize=ifa->iface->mtu;
+ ifa->dr_sk->data=(void *)ifa;
+ if(sk_open(ifa->dr_sk)!=0)
+ {
+ DBG("%s: SK_OPEN: new? mc open failed.\n", p->name);
+ }
}
}
else
@@ -52,7 +57,7 @@ iface_chstate(struct ospf_iface *ifa, u8 state)
if(ifa->dr_sk!=NULL)
{
sk_close(ifa->dr_sk);
- rfree(ifa->dr_sk);
+ rfree(ifa->dr_sk);
}
}
}