]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
IPv6: Absolutize link-scope addresses of incoming packets.
authorMartin Mares <mj@ucw.cz>
Tue, 30 May 2000 22:48:14 +0000 (22:48 +0000)
committerMartin Mares <mj@ucw.cz>
Tue, 30 May 2000 22:48:14 +0000 (22:48 +0000)
IPv6 socket interface is hopefully right now.

proto/rip/rip.c

index 01a1aed6ab9ef14467762d063dd45d92f32095f0..e641124694fd68beda0a2ec34b72033d045cd570 100644 (file)
@@ -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;