summaryrefslogtreecommitdiffstats
path: root/proto/rip
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-05-31 00:48:14 +0200
committerMartin Mares <mj@ucw.cz>2000-05-31 00:48:14 +0200
commit3b0b2cb61f4e9c3bfbb4770b941c5aba56d9e70e (patch)
tree7ef9bf745ece4f75575b2d6e7200d72c91caa2b4 /proto/rip
parentcfa6ab0593a02c3d4d0d959c771f72430f1adf67 (diff)
downloadbird-3b0b2cb61f4e9c3bfbb4770b941c5aba56d9e70e.tar
bird-3b0b2cb61f4e9c3bfbb4770b941c5aba56d9e70e.zip
IPv6: Absolutize link-scope addresses of incoming packets.
IPv6 socket interface is hopefully right now.
Diffstat (limited to 'proto/rip')
-rw-r--r--proto/rip/rip.c12
1 files changed, 9 insertions, 3 deletions
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;