]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixes bugs in IPv6 code caused by recent commits.
authorOndrej Zajicek <santiago@crfreenet.org>
Wed, 5 Nov 2008 20:39:04 +0000 (21:39 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Wed, 5 Nov 2008 20:39:04 +0000 (21:39 +0100)
proto/bgp/packets.c
sysdep/unix/io.c

index 84e6ffd5ebc6ef33901599ed8f9964f1b30c3dc3..00cdf0361c5e65c0d30cb9d5a999f1432b96350c 100644 (file)
@@ -700,7 +700,7 @@ bgp_do_rx_update(struct bgp_conn *conn,
       /* Create fake NEXT_HOP attribute */
       if (len < 1 || (*x != 16 && *x != 32) || len < *x + 2)
        goto bad;
-      bgp_attach_attr_ip(&a0->eattrs, bgp_linpool, BA_NEXT_HOP, x[1]);
+      memcpy(bgp_attach_attr_wa(&a0->eattrs, bgp_linpool, BA_NEXT_HOP, 16), x+1, 16);
       len -= *x + 2;
       x += *x + 1;
 
index e67ed80fa0bac347a8837cb0b68502e2b8dce4eb..ddb3c4d956c6f38c8c25b97b1db8d99d4475ea13 100644 (file)
@@ -616,7 +616,7 @@ sk_set_ttl_int(sock *s)
   int one = 1;
 #ifdef IPV6
   if (s->type != SK_UDP_MC && s->type != SK_IP_MC &&
-      setsockopt(fd, SOL_IPV6, IPV6_UNICAST_HOPS, &s->ttl, sizeof(s->ttl)) < 0)
+      setsockopt(s->fd, SOL_IPV6, IPV6_UNICAST_HOPS, &s->ttl, sizeof(s->ttl)) < 0)
     return "IPV6_UNICAST_HOPS";
 #else
   if (setsockopt(s->fd, SOL_IP, IP_TTL, &s->ttl, sizeof(s->ttl)) < 0)