Revision 05476c4d proto/ospf/iface.c

View differences:

proto/ospf/iface.c
90 90
static int
91 91
ospf_sk_open(struct ospf_iface *ifa)
92 92
{
93
  struct proto_ospf *po = ifa->oa->po;
94

  
93 95
  sock *sk = sk_new(ifa->pool);
94 96
  sk->type = SK_IP;
95 97
  sk->dport = OSPF_PROTO;
......
121 123
    {
122 124
      ifa->all_routers = ifa->addr->brd;
123 125

  
124
      if (sk_set_broadcast(sk, 1) < 0)
126
      if (sk_setup_broadcast(sk) < 0)
125 127
        goto err;
126 128
    }
127 129
    else
......
141 143
  return 1;
142 144

  
143 145
 err:
146
  sk_log_error(sk, po->proto.name);
144 147
  rfree(sk);
145 148
  return 0;
146 149
}
......
151 154
  if (ifa->sk_dr)
152 155
    return;
153 156

  
154
  sk_join_group(ifa->sk, AllDRouters);
157
  if (sk_join_group(ifa->sk, AllDRouters) < 0)
158
    sk_log_error(ifa->sk, ifa->oa->po->proto.name);
159

  
155 160
  ifa->sk_dr = 1;
156 161
}
157 162

  
......
161 166
  if (!ifa->sk_dr)
162 167
    return;
163 168

  
164
  sk_leave_group(ifa->sk, AllDRouters);
169
  if (sk_leave_group(ifa->sk, AllDRouters) < 0)
170
    sk_log_error(ifa->sk, ifa->oa->po->proto.name);
171

  
165 172
  ifa->sk_dr = 0;
166 173
}
167 174

  
168 175
void
169 176
ospf_open_vlink_sk(struct proto_ospf *po)
170 177
{
171
  struct proto *p = &po->proto;
172

  
173 178
  sock *sk = sk_new(po->proto.pool);
174 179
  sk->type = SK_IP;
175 180
  sk->dport = OSPF_PROTO;
......
197 202
  return;
198 203

  
199 204
 err:
205
  sk_log_error(sk, po->proto.name);
206
  log(L_ERR "%s: Cannot open virtual link socket", po->proto.name);
200 207
  rfree(sk);
201
  log(L_ERR "%s: Cannot open virtual link socket", p->name);
202 208
}
203 209

  
204 210
static void
......
463 469
  /* Open socket if interface is not stub */
464 470
  if (! ifa->stub && ! ospf_sk_open(ifa))
465 471
  {
466
    log(L_ERR "%s: Socket open failed on interface %s, declaring as stub", p->name, ifa->ifname);
472
    log(L_ERR "%s: Cannot open socket for %s, declaring as stub", p->name, ifa->ifname);
467 473
    ifa->ioprob = OSPF_I_SK;
468 474
    ifa->stub = 1;
469 475
  }

Also available in: Unified diff