Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net propose better IPv6 ifid alternative to the peer, wh...



details:   https://anonhg.NetBSD.org/src/rev/770c608e8330
branches:  trunk
changeset: 486232:770c608e8330
user:      itojun <itojun%NetBSD.org@localhost>
date:      Tue May 16 05:45:27 2000 +0000

description:
propose better IPv6 ifid alternative to the peer, when ifid collides
during IPv6CP negotiation.  it is very rare to see collision.

diffstat:

 sys/net/if_spppsubr.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r 257551b2e17a -r 770c608e8330 sys/net/if_spppsubr.c
--- a/sys/net/if_spppsubr.c     Tue May 16 04:55:58 2000 +0000
+++ b/sys/net/if_spppsubr.c     Tue May 16 05:45:27 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_spppsubr.c,v 1.9 2000/05/02 12:43:16 itojun Exp $    */
+/*     $NetBSD: if_spppsubr.c,v 1.10 2000/05/16 05:45:27 itojun Exp $   */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -4920,11 +4920,19 @@
 sppp_suggest_ip6_addr(struct sppp *sp, struct in6_addr *suggest)
 {
        struct in6_addr myaddr;
+       struct timeval tv;
 
        sppp_get_ip6_addrs(sp, &myaddr, 0, 0);
 
        myaddr.s6_addr[8] &= ~0x02;     /* u bit to "local" */
-       myaddr.s6_addr[15] ^= ~0xff;
+       microtime(&tv);
+       if ((tv.tv_usec & 0xff) == 0 && (tv.tv_sec & 0xff) == 0) {
+               myaddr.s6_addr[14] ^= 0xff;
+               myaddr.s6_addr[15] ^= 0xff;
+       } else {
+               myaddr.s6_addr[14] ^= (tv.tv_usec & 0xff);
+               myaddr.s6_addr[15] ^= (tv.tv_sec & 0xff);
+       }
        if (suggest)
                bcopy(&myaddr, suggest, sizeof(myaddr));
 }



Home | Main Index | Thread Index | Old Index