From owner-FreeBSD-users-jp@jp.freebsd.org  Sun May  6 01:57:35 2001
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id BAA40420;
	Sun, 6 May 2001 01:57:35 +0900 (JST)
	(envelope-from owner-FreeBSD-users-jp@jp.FreeBSD.org)
Received: from tortoise.jp.freebsd.org (root@tortoise.jp.FreeBSD.ORG [210.157.158.41])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id BAA40415
	for <FreeBSD-users-jp@jp.freebsd.org>; Sun, 6 May 2001 01:57:34 +0900 (JST)
	(envelope-from yohta@mistral.imasy.or.jp)
Received: from mistral.imasy.or.jp (root@[3ffe:505:2020:1:9862:d6f:50d0:dd32])
	by tortoise.jp.freebsd.org (8.11.3+3.4W/8.11.3) with ESMTP/inet6 id f45GvTb14423
	for <FreeBSD-users-jp@jp.freebsd.org>; Sun, 6 May 2001 01:57:30 +0900 (JST)
	(envelope-from yohta@mistral.imasy.or.jp)
Received: (from yohta@localhost)
	by mistral.imasy.or.jp (8.11.3/8.11.3/mistral) id f45Guxs03715;
	Sun, 6 May 2001 01:56:59 +0900 (JST)
	(envelope-from yohta)
From: mistral@imasy.or.jp (Yoshihiko SARUMARU)
To: FreeBSD-users-jp@jp.freebsd.org
In-Reply-To: Your message of "Sun, 6 May 2001 00:29:57 +0900".
	<010506002957.M0103204@mistral.imasy.or.jp>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-2022-JP
X-Mailer: mnews [version 1.22PL5] 2001-02/07(Wed)
Date: Sun, 6 May 2001 01:56:58 +0900
Message-ID: <010506015658.M0103698@mistral.imasy.or.jp>
Reply-To: FreeBSD-users-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+010328
X-Sequence: FreeBSD-users-jp 61201
Subject: [FreeBSD-users-jp 61201] Re: Can't rewrite resolv.conf on ppp
Errors-To: owner-FreeBSD-users-jp@jp.freebsd.org
Sender: owner-FreeBSD-users-jp@jp.freebsd.org
X-Originator: mistral@imasy.or.jp

$B!!1n4]$G$9!#(B

2001-05-06($BF|(B) 00:29:57.$B:"!";d$O=q$-$^$7$?!#(B

>   $B$H;W$C$F(B ppp $B$N%=!<%9$H$K$i$a$C$3$7$F$_$^$7$?$,!"$J$s$+9=B$$,(B
> $B$h$/$o$+$i$J$$!D!D!#(Bipcp.c $B$8$c$J$/$F(B fsm.c $B$r$_$J$$$H$$$1$J$$$N(B
> $B$+$7$i!#(B

  $B$A$g!<%F%-%H!<!"$J%Q%C%A$r=q$$$F$_$^$7$?!#(B

--- ipcp.c.orig	Fri Feb 23 12:03:41 2001
+++ ipcp.c	Sun May  6 01:40:09 2001
@@ -1271,6 +1271,7 @@
 
     case TY_PRIMARY_DNS:	/* DNS negotiation (rfc1877) */
     case TY_SECONDARY_DNS:
+      printf(">>%d\n", mode_type);
       memcpy(&ipaddr.s_addr, cp + 2, 4);
       log_Printf(LogIPCP, "%s %s\n", tbuff, inet_ntoa(ipaddr));
 
@@ -1318,8 +1319,16 @@
 	break;
 
       case MODE_REJ:		/* Can't do much, stop asking */
-        ipcp->peer_reject |= (1 << (type - TY_ADJUST_NS));
+	{
+	  static int first_try[2] = {1, 1};
+	  if (first_try[type == TY_PRIMARY_DNS ? 0 : 1]) {
+	    ipcp->dns[type == TY_PRIMARY_DNS ? 0 : 1].s_addr = 0;
+	    first_try[type == TY_PRIMARY_DNS ? 0 : 1] = 0;
+	  } else {
+	    ipcp->peer_reject |= (1 << (type - TY_ADJUST_NS));
+	  }
 	break;
+	}
       }
       break;
 

[$B$H$j$"$($::#$N(B resolv.conf $B$+$i(B SendConfigReq]
IPCP: deflink: SendConfigReq(1) state = Closed
IPCP:  IPADDR[6]  127.0.0.1
IPCP:  COMPPROTO[6]  16 VJ slots with slot compression
IPCP:  PRIDNS[6]  0.0.0.3
IPCP:  SECDNS[6]  202.227.24.4
IPCP: deflink: State change Closed --> Req-Sent

[his address $B$O$H$j$"$($:4X78$J$7(B]
IPCP: deflink: RecvConfigReq(1) state = Req-Sent
IPCP:  COMPPROTO[6]  16 VJ slots with slot compression
IPCP:  IPADDR[6]  211.14.73.52
IPCP: deflink: SendConfigAck(1) state = Req-Sent
IPCP:  COMPPROTO[6]  16 VJ slots with slot compression
IPCP:  IPADDR[6]  211.14.73.52
IPCP: deflink: State change Req-Sent --> Ack-Sent

[Reject $B$5$l$k(B]
IPCP: deflink: RecvConfigRej(1) state = Ack-Sent
IPCP:  PRIDNS[6]  0.0.0.3
IPCP:  SECDNS[6]  202.227.24.4

[DNS $B$O(B 0.0.0.0 $B$G:FEY(B SendConfigReq]
# $B%Q%C%A$J$7$@$H!"$3$3$G(B PRIDNS, SECDNS $B$,=P$F$3$J$/$J$k(B
IPCP: deflink: SendConfigReq(2) state = Ack-Sent
IPCP:  IPADDR[6]  127.0.0.1
IPCP:  COMPPROTO[6]  16 VJ slots with slot compression
IPCP:  PRIDNS[6]  0.0.0.0
IPCP:  SECDNS[6]  0.0.0.0

[RecvConfigNak $B$G!"(BDNS $B%5!<%P$,Ds<($5$l$k(B]
IPCP: deflink: RecvConfigNak(2) state = Ack-Sent
IPCP:  IPADDR[6]  211.14.108.47
IPCP:  IPADDR[6]  changing address: 127.0.0.1  --> 211.14.108.47
IPCP:  PRIDNS[6]  211.14.74.49
IPCP:  SECDNS[6]  211.14.74.50
IPCP: Primary nameserver set to 211.14.74.49
IPCP: Secondary nameserver set to 211.14.74.50

[$BDs<($5$l$?(B DNS $B%5!<%P$G;0EY(B SendConfigReq]
IPCP: deflink: SendConfigReq(3) state = Ack-Sent
IPCP:  IPADDR[6]  211.14.108.47
IPCP:  COMPPROTO[6]  16 VJ slots with slot compression
IPCP:  PRIDNS[6]  211.14.74.49
IPCP:  SECDNS[6]  211.14.74.50

[Ack $B$,$+$($C$F$-$F$*$7$^$$(B]
IPCP: deflink: RecvConfigAck(3) state = Ack-Sent
IPCP: deflink: State change Ack-Sent --> Opened
IPCP: deflink: LayerUp.
IPCP: myaddr 211.14.108.47 hisaddr = 211.14.73.52


>   IPCP $B$N(B MS$B3HD%$K$J$C$F$k$d$D$N>uBVA+0\?^$C$F$I$3$+$K:\$C$F$J$$(B
> $B$G$9$+$M$'!#(B

RFC 1877 $B$K$O(B
      on the local end of the link.  If local peer requests an invalid
      server address (which it will typically do intentionally) the
      remote peer specifies the address by NAKing this option, and
      returning the IP address of a valid DNS server.
$B$H$"$j$^$9$7!"(Bppp $B%3%^%s%I$O%5!<%P$+$i(B Rej $B$G$J$/(B Nak $B$r<u$1<h$k(B
$B$3$H$r4|BT$7$F$$$k$s$8$c$J$$$+$J$!!"$H$$$&5$$,$7$^$9!#(B

  $B;EMME*$K$O(B Reject $B$5$l$?$i(B $B$b$&(B DNS negotiation $B$O;_$a$k$N$,@5(B
$B$7$$$h$&$J5$$,$7$^$9$,!"5$$N$;$$$+$b$7$l$^$;$s!#(B


  $B$I$J$?$+$3$NJU>\$7$$J}$$$i$C$7$c$$$^$;$s$+!#(B

--
$B1n4]K'I'(B (Yoshihiko SARUMARU)
mail: mistral@imasy.or.jp       web: http://www.imasy.or.jp/~mistral/
