Sat Apr 2 10:19:27 2011 UTC ()
Fix PR 42923, from Takahiro HAYASHI, thanks.


(mbalmer)
diff -r1.62 -r1.63 src/usr.sbin/pppd/pppd/sys-bsd.c

cvs diff -r1.62 -r1.63 src/usr.sbin/pppd/pppd/Attic/sys-bsd.c (expand / switch to unified diff)

--- src/usr.sbin/pppd/pppd/Attic/sys-bsd.c 2010/03/10 13:45:39 1.62
+++ src/usr.sbin/pppd/pppd/Attic/sys-bsd.c 2011/04/02 10:19:27 1.63
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: sys-bsd.c,v 1.62 2010/03/10 13:45:39 christos Exp $ */ 1/* $NetBSD: sys-bsd.c,v 1.63 2011/04/02 10:19:27 mbalmer Exp $ */
2 2
3/* 3/*
4 * sys-bsd.c - System-dependent procedures for setting up 4 * sys-bsd.c - System-dependent procedures for setting up
5 * PPP interfaces on bsd-4.4-ish systems (including 386BSD, NetBSD, etc.) 5 * PPP interfaces on bsd-4.4-ish systems (including 386BSD, NetBSD, etc.)
6 * 6 *
7 * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved. 7 * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 12 *
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -69,27 +69,27 @@ @@ -69,27 +69,27 @@
69 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 69 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
70 * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 70 * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
71 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 71 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
72 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 72 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
73 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 73 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
74 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 74 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
75 */ 75 */
76 76
77#include <sys/cdefs.h> 77#include <sys/cdefs.h>
78#ifndef lint 78#ifndef lint
79#if 0 79#if 0
80#define RCSID "Id: sys-bsd.c,v 1.47 2000/04/13 12:04:23 paulus Exp " 80#define RCSID "Id: sys-bsd.c,v 1.47 2000/04/13 12:04:23 paulus Exp "
81#else 81#else
82__RCSID("$NetBSD: sys-bsd.c,v 1.62 2010/03/10 13:45:39 christos Exp $"); 82__RCSID("$NetBSD: sys-bsd.c,v 1.63 2011/04/02 10:19:27 mbalmer Exp $");
83#endif 83#endif
84#endif 84#endif
85 85
86/* 86/*
87 * TODO: 87 * TODO:
88 */ 88 */
89 89
90#include <stdio.h> 90#include <stdio.h>
91#include <string.h> 91#include <string.h>
92#include <stdlib.h> 92#include <stdlib.h>
93#include <unistd.h> 93#include <unistd.h>
94#include <errno.h> 94#include <errno.h>
95#include <fcntl.h> 95#include <fcntl.h>
@@ -783,27 +783,27 @@ sif6addr(int unit, eui64_t our_eui64, eu @@ -783,27 +783,27 @@ sif6addr(int unit, eui64_t our_eui64, eu
783 IN6_IFINDEX(addreq6.ifra_addr, ifindex); 783 IN6_IFINDEX(addreq6.ifra_addr, ifindex);
784 784
785#ifdef notdef 785#ifdef notdef
786 /* his addr */ 786 /* his addr */
787 IN6_LLADDR_FROM_EUI64(addreq6.ifra_dstaddr, his_eui64); 787 IN6_LLADDR_FROM_EUI64(addreq6.ifra_dstaddr, his_eui64);
788 IN6_IFINDEX(addreq6.ifra_dstaddr, ifindex); 788 IN6_IFINDEX(addreq6.ifra_dstaddr, ifindex);
789#endif 789#endif
790 790
791 /* prefix mask: 72bit */ 791 /* prefix mask: 72bit */
792 addreq6.ifra_prefixmask.sin6_family = AF_INET6; 792 addreq6.ifra_prefixmask.sin6_family = AF_INET6;
793 addreq6.ifra_prefixmask.sin6_len = sizeof(struct sockaddr_in6); 793 addreq6.ifra_prefixmask.sin6_len = sizeof(struct sockaddr_in6);
794 memset(&addreq6.ifra_prefixmask.sin6_addr, 0xff, 794 memset(&addreq6.ifra_prefixmask.sin6_addr, 0xff,
795 sizeof(addreq6.ifra_prefixmask.sin6_addr) - sizeof(our_eui64)); 795 sizeof(addreq6.ifra_prefixmask.sin6_addr) - sizeof(our_eui64));
796 memset(&addreq6.ifra_prefixmask.sin6_addr + 796 memset((char *)&addreq6.ifra_prefixmask.sin6_addr +
797 sizeof(addreq6.ifra_prefixmask.sin6_addr) - sizeof(our_eui64), 0x00, 797 sizeof(addreq6.ifra_prefixmask.sin6_addr) - sizeof(our_eui64), 0x00,
798 sizeof(our_eui64)); 798 sizeof(our_eui64));
799 799
800 /* address lifetime (infty) */ 800 /* address lifetime (infty) */
801 addreq6.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME; 801 addreq6.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME;
802 addreq6.ifra_lifetime.ia6t_vltime = ND6_INFINITE_LIFETIME; 802 addreq6.ifra_lifetime.ia6t_vltime = ND6_INFINITE_LIFETIME;
803 803
804 if (ioctl(sock6_fd, SIOCAIFADDR_IN6, &addreq6) < 0) { 804 if (ioctl(sock6_fd, SIOCAIFADDR_IN6, &addreq6) < 0) {
805 error("%s: sif6addr: ioctl(SIOCAIFADDR_IN6): %m", __func__); 805 error("%s: sif6addr: ioctl(SIOCAIFADDR_IN6): %m", __func__);
806 return 0; 806 return 0;
807 } 807 }
808 808
809 return 1; 809 return 1;