Commit 3e95b06b authored by Maria Matejka's avatar Maria Matejka
Browse files

OSPF interface socket must be allocated from the protocol pool

The socket rx must be closed asynchronously and it is easier to use the
existing infrastructure of async socket closing for protocols.

In future, there may be a more universal mechanism for async socket
closing, yet it is not needed now.
parent 9f501038
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ ospf_sk_open(struct ospf_iface *ifa)
{
  struct ospf_proto *p = ifa->oa->po;

  sock *sk = sk_new(ifa->pool);
  sock *sk = sk_new(p->p.pool);
  sk->type = SK_IP;
  sk->subtype = ospf_is_v2(p) ? SK_IPV4 : SK_IPV6;
  sk->dport = OSPF_PROTO;
@@ -305,6 +305,9 @@ ospf_iface_remove(struct ospf_iface *ifa)
  struct ospf_proto *p = ifa->oa->po;
  int i;

  if (ifa->sk)
    sk_close(ifa->sk);

  if (ifa->type == OSPF_IT_VLINK)
    OSPF_TRACE(D_EVENTS, "Removing vlink to %R via area %R", ifa->vid, ifa->voa->areaid);