Tue May 11 06:58:03 2021 UTC ()
Make authproto not change when "authproto" is not in command option


(yamaguchi)
diff -r1.28 -r1.29 src/sbin/pppoectl/pppoectl.c

cvs diff -r1.28 -r1.29 src/sbin/pppoectl/pppoectl.c (expand / switch to unified diff)

--- src/sbin/pppoectl/pppoectl.c 2021/05/11 05:51:42 1.28
+++ src/sbin/pppoectl/pppoectl.c 2021/05/11 06:58:03 1.29
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pppoectl.c,v 1.28 2021/05/11 05:51:42 yamaguchi Exp $ */ 1/* $NetBSD: pppoectl.c,v 1.29 2021/05/11 06:58:03 yamaguchi Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1997 Joerg Wunsch 4 * Copyright (c) 1997 Joerg Wunsch
5 * 5 *
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * 27 *
28 * From: spppcontrol.c,v 1.3 1998/01/07 07:55:26 charnier Exp 28 * From: spppcontrol.c,v 1.3 1998/01/07 07:55:26 charnier Exp
29 * From: ispppcontrol 29 * From: ispppcontrol
30 */ 30 */
31#include <sys/cdefs.h> 31#include <sys/cdefs.h>
32 32
33#ifndef lint 33#ifndef lint
34__RCSID("$NetBSD: pppoectl.c,v 1.28 2021/05/11 05:51:42 yamaguchi Exp $"); 34__RCSID("$NetBSD: pppoectl.c,v 1.29 2021/05/11 06:58:03 yamaguchi Exp $");
35#endif 35#endif
36 36
37 37
38#include <sys/param.h> 38#include <sys/param.h>
39#include <sys/callout.h> 39#include <sys/callout.h>
40#include <sys/ioctl.h> 40#include <sys/ioctl.h>
41#include <sys/socket.h> 41#include <sys/socket.h>
42#include <sys/time.h> 42#include <sys/time.h>
43#include <sys/sysctl.h> 43#include <sys/sysctl.h>
44#include <net/if.h> 44#include <net/if.h>
45#include <net/if_sppp.h> 45#include <net/if_sppp.h>
46#include <net/if_pppoe.h> 46#include <net/if_pppoe.h>
47#include <arpa/inet.h> 47#include <arpa/inet.h>
@@ -193,26 +193,28 @@ main(int argc, char **argv) @@ -193,26 +193,28 @@ main(int argc, char **argv)
193 } 193 }
194 194
195 if (dns1 || dns2) { 195 if (dns1 || dns2) {
196 print_dns(ifname, dns1, dns2, s, 0); 196 print_dns(ifname, dns1, dns2, s, 0);
197 } 197 }
198 198
199 if (dump) { 199 if (dump) {
200 print_stats(ifname, s, dump); 200 print_stats(ifname, s, dump);
201 return 0; 201 return 0;
202 } 202 }
203 203
204 memset(&spr, 0, sizeof spr); 204 memset(&spr, 0, sizeof spr);
205 strncpy(spr.ifname, ifname, sizeof spr.ifname); 205 strncpy(spr.ifname, ifname, sizeof spr.ifname);
 206 spr.myauth = SPPP_AUTHPROTO_NOCHG;
 207 spr.hisauth = SPPP_AUTHPROTO_NOCHG;
206 memset(&lcp, 0, sizeof lcp); 208 memset(&lcp, 0, sizeof lcp);
207 strncpy(lcp.ifname, ifname, sizeof lcp.ifname); 209 strncpy(lcp.ifname, ifname, sizeof lcp.ifname);
208 memset(&ncp, 0, sizeof ncp); 210 memset(&ncp, 0, sizeof ncp);
209 strncpy(ncp.ifname, ifname, sizeof ncp.ifname); 211 strncpy(ncp.ifname, ifname, sizeof ncp.ifname);
210 memset(&status, 0, sizeof status); 212 memset(&status, 0, sizeof status);
211 strncpy(status.ifname, ifname, sizeof status.ifname); 213 strncpy(status.ifname, ifname, sizeof status.ifname);
212 memset(&timeout, 0, sizeof timeout); 214 memset(&timeout, 0, sizeof timeout);
213 strncpy(timeout.ifname, ifname, sizeof timeout.ifname); 215 strncpy(timeout.ifname, ifname, sizeof timeout.ifname);
214 memset(&authfailstats, 0, sizeof authfailstats); 216 memset(&authfailstats, 0, sizeof authfailstats);
215 strncpy(authfailstats.ifname, ifname, sizeof authfailstats.ifname); 217 strncpy(authfailstats.ifname, ifname, sizeof authfailstats.ifname);
216 memset(&authfailset, 0, sizeof authfailset); 218 memset(&authfailset, 0, sizeof authfailset);
217 strncpy(authfailset.ifname, ifname, sizeof authfailset.ifname); 219 strncpy(authfailset.ifname, ifname, sizeof authfailset.ifname);
218 memset(&dnssettings, 0, sizeof dnssettings); 220 memset(&dnssettings, 0, sizeof dnssettings);