/* lookup multicasts over unnumbered links - no: rip is not defined over unnumbered links */
if(want_multicast)
DBG("Doing multicasts!\n");
rif->sock=sk_new(p->pool);
rif->sock->type=want_multicast?SK_UDP_MC:SK_UDP;
rif->sock->sport=P_CF->port;
...
...
@@ -484,8 +489,10 @@ new_iface(struct proto *p, struct iface *new, unsigned long flags, struct iface_
rif->sock->dport=P_CF->port;
rif->sock->ttl=1;/* FIXME: care must be taken not to send requested responses from this socket */
if(want_multicast)
if(want_multicast){
rif->sock->daddr=ipa_from_u32(0xe0000009);
rif->sock->saddr=ipa_from_u32(0xe0000009);
}
if(flags&IF_BROADCAST)
rif->sock->daddr=new->addr->brd;
if(flags&IF_UNNUMBERED)/* Hmm, rip is not defined over unnumbered links */
...
...
@@ -495,8 +502,12 @@ new_iface(struct proto *p, struct iface *new, unsigned long flags, struct iface_
log(L_WARN"RIP/%s: interface %s is too strange for me",P_NAME,rif->iface?rif->iface->name:"(dummy)");
}else
if(!(rif->patt->mode&IM_NOLISTEN))
if(sk_open(rif->sock)<0)
if(sk_open(rif->sock)<0){
log(L_WARN"RIP/%s: could not listen on %s",P_NAME,rif->iface?rif->iface->name:"(dummy)");
/* FIXME: Don't try to transmit into this one */
}
log(L_DEBUG"RIP/%s: listening on %s, port %d, mode %s",P_NAME,rif->iface?rif->iface->name:"(dummy)",P_CF->port,want_multicast?"multicast":"broadcast");
returnrif;
}
...
...
@@ -644,6 +655,8 @@ rip_init_instance(struct proto *p)