diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2014-05-18 11:42:26 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2014-05-18 11:42:26 +0200 |
commit | 05476c4d04a24bdb26fa64e05ab31bc36118f34e (patch) | |
tree | e775f059cfb4bb027c444bb53eb9356e643082c8 /proto/rip | |
parent | 1149aa977d906a6400f998d5f6600871584395d0 (diff) |
IPv4/IPv6 integrated socket code.
Diffstat (limited to 'proto/rip')
-rw-r--r-- | proto/rip/rip.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/proto/rip/rip.c b/proto/rip/rip.c index 9730df77..bc9ffc5f 100644 --- a/proto/rip/rip.c +++ b/proto/rip/rip.c @@ -483,10 +483,10 @@ rip_rx(sock *s, int size) iface = i->iface; #endif - if (i->check_ttl && (s->ttl < 255)) + if (i->check_ttl && (s->rcv_ttl < 255)) { log( L_REMOTE "%s: Discarding packet with TTL %d (< 255) from %I on %s", - p->name, s->ttl, s->faddr, i->iface->name); + p->name, s->rcv_ttl, s->faddr, i->iface->name); return 1; } @@ -733,7 +733,7 @@ new_iface(struct proto *p, struct iface *new, unsigned long flags, struct iface_ log( L_WARN "%s: interface %s is too strange for me", p->name, rif->iface->name ); } else { - if (sk_open(rif->sock)<0) + if (sk_open(rif->sock) < 0) goto err; if (rif->multicast) @@ -745,7 +745,7 @@ new_iface(struct proto *p, struct iface *new, unsigned long flags, struct iface_ } else { - if (sk_set_broadcast(rif->sock, 1) < 0) + if (sk_setup_broadcast(rif->sock) < 0) goto err; } } @@ -755,7 +755,8 @@ new_iface(struct proto *p, struct iface *new, unsigned long flags, struct iface_ return rif; err: - log( L_ERR "%s: could not create socket for %s", p->name, rif->iface ? rif->iface->name : "(dummy)" ); + sk_log_error(rif->sock, p->name); + log(L_ERR "%s: Cannot open socket for %s", p->name, rif->iface ? rif->iface->name : "(dummy)" ); if (rif->iface) { rfree(rif->sock); mb_free(rif); |