From 3b0b2cb61f4e9c3bfbb4770b941c5aba56d9e70e Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Tue, 30 May 2000 22:48:14 +0000 Subject: IPv6: Absolutize link-scope addresses of incoming packets. IPv6 socket interface is hopefully right now. --- proto/rip/rip.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'proto/rip') diff --git a/proto/rip/rip.c b/proto/rip/rip.c index 01a1aed..e641124 100644 --- a/proto/rip/rip.c +++ b/proto/rip/rip.c @@ -269,7 +269,8 @@ advertise_entry( struct proto *p, struct rip_block *b, ip_addr whotoldme ) A.gw = ipa_nonzero(b->nexthop) ? b->nexthop : whotoldme; pxlen = ipa_mklen(b->netmask); #else - A.gw = whotoldme; /* FIXME: next hop is in other packet for v6 */ + /* FIXME: next hop is in other packet for v6 */ + A.gw = whotoldme; pxlen = b->pxlen; #endif A.from = whotoldme; @@ -413,6 +414,11 @@ rip_rx(sock *s, int size) num = size / sizeof( struct rip_block ); if (num>PACKET_MAX) BAD( "Too many blocks" ); +#ifdef IPV6 + /* Try to absolutize link scope addresses */ + ipa_absolutize(&s->faddr, &i->iface->addr->ip); +#endif + if (ipa_equal(i->iface->addr->ip, s->faddr)) { DBG("My own packet\n"); return 1; @@ -626,8 +632,8 @@ new_iface(struct proto *p, struct iface *new, unsigned long flags, struct iface_ rif->sock->daddr = ipa_from_u32(0xe0000009); rif->sock->saddr = ipa_from_u32(0xe0000009); #else - ip_pton("FF02::9", &rif->sock->daddr); /* FIXME [mj] */ - ip_pton("FF02::9", &rif->sock->saddr); + rif->sock->daddr = ipa_build(0xff020000, 0, 0, 9); + rif->sock->saddr = new->addr->ip; #endif } else { rif->sock->daddr = new->addr->brd; -- cgit v1.2.3