IPv6: Absolutize link-scope addresses of incoming packets.

IPv6 socket interface is hopefully right now.
This commit is contained in:
Martin Mares 2000-05-30 22:48:14 +00:00
parent cfa6ab0593
commit 3b0b2cb61f

View 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; A.gw = ipa_nonzero(b->nexthop) ? b->nexthop : whotoldme;
pxlen = ipa_mklen(b->netmask); pxlen = ipa_mklen(b->netmask);
#else #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; pxlen = b->pxlen;
#endif #endif
A.from = whotoldme; A.from = whotoldme;
@ -413,6 +414,11 @@ rip_rx(sock *s, int size)
num = size / sizeof( struct rip_block ); num = size / sizeof( struct rip_block );
if (num>PACKET_MAX) BAD( "Too many blocks" ); 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)) { if (ipa_equal(i->iface->addr->ip, s->faddr)) {
DBG("My own packet\n"); DBG("My own packet\n");
return 1; 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->daddr = ipa_from_u32(0xe0000009);
rif->sock->saddr = ipa_from_u32(0xe0000009); rif->sock->saddr = ipa_from_u32(0xe0000009);
#else #else
ip_pton("FF02::9", &rif->sock->daddr); /* FIXME [mj] */ rif->sock->daddr = ipa_build(0xff020000, 0, 0, 9);
ip_pton("FF02::9", &rif->sock->saddr); rif->sock->saddr = new->addr->ip;
#endif #endif
} else { } else {
rif->sock->daddr = new->addr->brd; rif->sock->daddr = new->addr->brd;