4 --- pptp.c.orig 1998/09/02 14:40:54
5 +++ pptp.c 1999/02/12 14:23:28
7 /* Step 1: Get IP address for the hostname in argv[1] */
8 inetaddr = get_ip_address(argv[1]);
10 + log("using remote IP address %s\n", inet_ntoa(inetaddr));
12 /* Step 2: Open connection to call manager
13 * (Launch call manager if necessary.)
18 /* Step 6: Do GRE copy until close. */
19 - pptp_gre_copy(call_id, peer_call_id, pty_fd, inetaddr);
21 + pptp_gre_copy(peer_call_id, call_id, pty_fd, inetaddr);
24 /* on close, kill all. */
25 kill(parent_pid, SIGTERM);
27 struct in_addr get_ip_address(char *name) {
28 struct in_addr retval;
29 struct hostent *host = gethostbyname(name);
32 if (h_errno == HOST_NOT_FOUND)
33 fatal("gethostbyname: HOST NOT FOUND");
34 else if (h_errno == NO_ADDRESS)
35 fatal("gethostbyname: NO IP ADDRESS");
37 fatal("gethostbyname: name server error");
40 if (host->h_addrtype != AF_INET)
41 fatal("Host has non-internet address");
43 new_argv[0] = PPPD_BINARY;
45 new_argv[2] = "38400";
46 - for (i=0; i<argc; i++)
47 - new_argv[i+3] = argv[i];
48 + fprintf(stderr, "running pppd: %s %s %s", new_argv[0], new_argv[1], new_argv[2]);
49 + for (i=0; i<argc; i++) {
50 + fprintf(stderr, " %s", argv[i]);
51 + new_argv[i+3] = argv[i];
53 + fprintf(stderr, "\n");
56 execvp(new_argv[0], new_argv);