[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
pptp patch to be submitted to maintainer- please test!
- To: linux-il(at-nospam)linux.org.il
- Subject: pptp patch to be submitted to maintainer- please test!
- From: mulix <mulix(at-nospam)actcom.co.il>
- Date: Sat, 03 Feb 2001 16:31:26 +0200
- Delivered-To: linux.org.il-linux-il@linux.org.il
- Sender: mulix(at-nospam)lmail.actcom.co.il
- Sender: linux-il-bounce(at-nospam)cs.huji.ac.il
hi everyone
i cleaned up the patch to pptp and put up a new pptp-mulix-0.06.tar.gz
at http://www.pointer.co.il/~mulix/
ADSL users, and especially alcatel and orckit ATUR3 users, please test
and verify that it works for you.
as soon as i get positive test results i will forward the patch onwards
to the pptp maintainer and hopefully get it incorporated into the main
pptp tree.
patch attached below
--
mulix
http://www.advogato.com/person/mulix
linux/reboot.h: #define LINUX_REBOOT_MAGIC1 0xfee1dead
diff -u -r -b pptp-linux-1.0.2/Makefile pptp-mulix/Makefile
--- pptp-linux-1.0.2/Makefile Thu Feb 19 00:42:14 1998
+++ pptp-mulix/Makefile Sat Feb 3 16:04:43 2001
@@ -1,10 +1,11 @@
VERSION = 1.0.2
VERSION_DEFINE = '-DPPTP_LINUX_VERSION="${VERSION}"'
+PROTOCOL_DEFINE = '-DPPTP_BEZEQ_ISRAEL=1'
CC = gcc -Wall
DEBUG = -g
INCLUDE =
-CFLAGS = -O9 $(VERSION_DEFINE) $(DEBUG) $(INCLUDE)
+CFLAGS = -O9 $(VERSION_DEFINE) $(PROTOCOL_DEFINE) $(DEBUG) $(INCLUDE)
LIBS =
LDFLAGS =
@@ -36,7 +37,7 @@
$(CC) -o vector_test vector_test.o vector.o
clean:
- $(RM) *.o *~
+ $(RM) *.o *~ $(PPTP_BIN) $(CALLMGR_BIN) core
clobber: clean
$(RM) $(PPTP_BIN) $(CALLMGR_BIN) vector_test
Only in pptp-mulix/: pptp-linux-1.0.2-mulix.diff
diff -u -r -b pptp-linux-1.0.2/pptp.c pptp-mulix/pptp.c
--- pptp-linux-1.0.2/pptp.c Thu Feb 19 00:42:14 1998
+++ pptp-mulix/pptp.c Tue Jan 16 23:57:02 2001
@@ -1,6 +1,7 @@
/* pptp.c ... client shell to launch call managers, data handlers, and
* the pppd from the command line.
* C. Scott Ananian <cananian@alumni.princeton.edu>
+ * patched by mulix <mulix@actcom.co.il>
*
* $Id: pptp.c,v 1.7 1997/12/16 11:38:48 cananian Exp $
*/
@@ -40,6 +41,7 @@
void usage(char *progname) {
fprintf(stderr,
"%s\n"
+ "patched by mulix <mulix@actcom.co.il>\n"
"Usage:\n"
" %s hostname [pppd options]\n", version, progname);
exit(1);
@@ -69,6 +71,7 @@
usage(argv[0]);
/* Step 1: Get IP address for the hostname in argv[1] */
+ log("trying to connect to '%s'\n", argv[1]);
inetaddr = get_ip_address(argv[1]);
/* Step 2: Open connection to call manager
diff -u -r -b pptp-linux-1.0.2/pptp_callmgr.c pptp-mulix/pptp_callmgr.c
--- pptp-linux-1.0.2/pptp_callmgr.c Thu Feb 19 00:42:14 1998
+++ pptp-mulix/pptp_callmgr.c Wed Jan 17 00:11:02 2001
@@ -186,6 +186,7 @@
struct local_callinfo *lci;
int s;
+ log("new call!");
/* Accept the socket */
if ((s = accept(unix_sock, (struct sockaddr *) &from, &len))<0) {
warn("Socket not accepted: %s", strerror(errno));
diff -u -r -b pptp-linux-1.0.2/pptp_ctrl.c pptp-mulix/pptp_ctrl.c
--- pptp-linux-1.0.2/pptp_ctrl.c Thu Feb 19 00:42:14 1998
+++ pptp-mulix/pptp_ctrl.c Sat Feb 3 16:02:39 2001
@@ -206,10 +206,15 @@
{
struct pptp_out_call_rqst packet = {
PPTP_HEADER_CTRL(PPTP_OUT_CALL_RQST),
- hton16(call->call_id), hton16(call->sernum),
+ 0, /* hton16(call->callid) */
+ 0, /* hton16(call->sernum) */
hton32(PPTP_BPS_MIN), hton32(PPTP_BPS_MAX),
+#ifndef PPTP_BEZEQ_ISRAEL
hton32(PPTP_BEARER_CAP), hton32(PPTP_FRAME_CAP),
- hton16(PPTP_WINDOW), 0, 0, 0, {0}, {0}
+#else
+ hton32(PPTP_BEARER_DIGITAL), hton32(PPTP_FRAME_ANY),
+#endif
+ hton16(PPTP_WINDOW), 0, hton16(PPTP_HOSTNAME_LEN),0, PPTP_HOSTNAME, {0}
};
if (pptp_send_ctrl_packet(conn, &packet, sizeof(packet))) {
pptp_reset_timer();
@@ -458,6 +463,22 @@
}
}
+static void
+pptp_set_link(PPTP_CONN* conn, int peer_call_id)
+{
+ struct pptp_set_link_info packet = {
+ PPTP_HEADER_CTRL(PPTP_SET_LINK_INFO),
+ hton16(peer_call_id),
+ 0,
+ 0xffffffff,
+ 0xffffffff};
+
+ if (pptp_send_ctrl_packet(conn, &packet, sizeof(packet))) {
+ log("pptp_set_link() packet sending succesfull");
+ pptp_reset_timer();
+ }
+}
+
void pptp_dispatch_ctrl_packet(PPTP_CONN * conn, void * buffer, size_t size) {
struct pptp_header *header = (struct pptp_header *)buffer;
u_int8_t close_reason = PPTP_STOP_NONE;
@@ -513,7 +534,10 @@
close_reason = PPTP_STOP_PROTOCOL;
goto pptp_conn_close;
}
- if (ntoh8(packet->result_code)!=1) { /* some problem with start */
+ /* alcatel modems in used israel require this change to function correctly*/
+ /* QUESTION: result code 0 does not appear in pptp-draft ? */
+ if ((ntoh8(packet->result_code)!=1) && (ntoh8(packet->result_code)!=0)){
+ /*some problem with start */
/* if result_code == 5, we might fall back to different version */
if (conn->callback!=NULL) conn->callback(conn, CONN_OPEN_FAIL);
close_reason = PPTP_STOP_PROTOCOL;
@@ -623,7 +647,8 @@
/* check for errors */
if (packet->result_code!=1) {
/* An error. Log it. */
- log("Error opening call. [callid %d]", (int) callid);
+ log("Error '%d' opening call. [callid %d]", packet->result_code, (int) callid);
+ log("Error code is '%d', Cause code is '%d'", packet->error_code, packet->cause_code);
call->state.pns = PNS_IDLE;
if (call->callback!=NULL) call->callback(conn, call, CALL_OPEN_FAIL);
pptp_call_destroy(conn, call);
@@ -633,6 +658,8 @@
call->peer_call_id = ntoh16(packet->call_id);
call->speed = ntoh32(packet->speed);
pptp_reset_timer();
+ log("calling pptp_set_link()");
+ pptp_set_link(conn, call->peer_call_id);
if (call->callback!=NULL) call->callback(conn, call, CALL_OPEN_DONE);
log("Outgoing call established.\n");
}
diff -u -r -b pptp-linux-1.0.2/pptp_gre.c pptp-mulix/pptp_gre.c
--- pptp-linux-1.0.2/pptp_gre.c Thu Feb 19 00:42:14 1998
+++ pptp-mulix/pptp_gre.c Sat Feb 3 14:38:56 2001
@@ -59,7 +59,8 @@
struct sockaddr_in src_addr;
int s, n, stat1, stat2;
- pptp_gre_call_id = call_id;
+ /* the orckit ATUR3 modem used in israel requires this change to work correctly */
+ pptp_gre_call_id = peer_call_id;
/* Open IP protocol socket */
s = socket(AF_INET, SOCK_RAW, PPTP_PROTO);
if (s<0) { warn("socket: %s", strerror(errno)); return; }
diff -u -r -b pptp-linux-1.0.2/pptp_options.h pptp-mulix/pptp_options.h
--- pptp-linux-1.0.2/pptp_options.h Thu Feb 19 00:42:14 1998
+++ pptp-mulix/pptp_options.h Sat Feb 3 16:07:24 2001
@@ -18,22 +18,33 @@
#define PPTP_BPS_MIN 2400
#define PPTP_BPS_MAX 10000000
-#ifndef STANDARD
-#define PPTP_MAX_CHANNELS 65535
-#define PPTP_FIRMWARE_STRING "0.01"
-#define PPTP_FIRMWARE_VERSION 0x001
-#define PPTP_HOSTNAME {'l','o','c','a','l',0}
-#define PPTP_VENDOR {'c','a','n','a','n','i','a','n',0}
-#define PPTP_FRAME_CAP PPTP_FRAME_ANY
-#define PPTP_BEARER_CAP PPTP_BEARER_DIGITAL
-#else
+#ifdef STANDARD
#define PPTP_MAX_CHANNELS 5
#define PPTP_FIRMWARE_STRING "0.01"
#define PPTP_FIRMWARE_VERSION 0
#define PPTP_HOSTNAME {'l','o','c','a','l',0}
+#define PPTP_HOSTNAME_LEN 5
#define PPTP_VENDOR {'N','T',0}
#define PPTP_FRAME_CAP 2
#define PPTP_BEARER_CAP 1
+#elif defined PPTP_BEZEQ_ISRAEL
+#define PPTP_MAX_CHANNELS 0
+#define PPTP_FIRMWARE_STRING "0x6021"
+#define PPTP_FIRMWARE_VERSION 0x6021
+#define PPTP_HOSTNAME {'R','E','L','A','Y','_','P','P','P','1',0}
+#define PPTP_HOSTNAME_LEN 10
+#define PPTP_VENDOR {'M','S',' ','W','i','n',' ','N','T',0}
+#define PPTP_FRAME_CAP PPTP_FRAME_ASYNC
+#define PPTP_BEARER_CAP PPTP_BEARER_ANALOG
+#else
+#define PPTP_MAX_CHANNELS 65535
+#define PPTP_FIRMWARE_STRING "0.01"
+#define PPTP_FIRMWARE_VERSION 0x001
+#define PPTP_HOSTNAME {'l','o','c','a','l',0}
+#define PPTP_HOSTNAME_LEN 5
+#define PPTP_VENDOR {'c','a','n','a','n','i','a','n',0}
+#define PPTP_FRAME_CAP PPTP_FRAME_ANY
+#define PPTP_BEARER_CAP PPTP_BEARER_DIGITAL
#endif
#endif /* INC_PPTP_OPTIONS_H */