1 diff -Nur tspc2/conf/Makefile tspc2.owrt/conf/Makefile
2 --- tspc2/conf/Makefile 2004-03-29 17:37:56.000000000 +0200
3 +++ tspc2.owrt/conf/Makefile 2007-02-19 16:07:05.000000000 +0100
5 sed -e "s+@ifname_tun@+$(ifname_tun)+" -e "s+@ifname@+$(ifname)+" -e "s+@target@+$(target)+" -e "s+@tsp_dir@+$(configdir)+" tspc.conf.in >$(BIN)/tspc.conf.sample; \
8 - chmod 700 $(BIN)/tspc.conf.sample
9 + chmod 600 $(BIN)/tspc.conf.sample
13 diff -Nur tspc2/conf/tspc.conf.in tspc2.owrt/conf/tspc.conf.in
14 --- tspc2/conf/tspc.conf.in 2004-06-15 17:01:01.000000000 +0200
15 +++ tspc2.owrt/conf/tspc.conf.in 2007-02-19 16:07:05.000000000 +0100
17 # to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19 #------------------------------------------------------------------------------
23 -# the only use is for the OS scripts which will be taken
24 -# from $tsp_dir/template
29 # authentication method:
34 -# template=checktunnel|freebsd|netbsd|linux|windows|darwin|cisco|
36 +# template=checktunnel|setup
38 # the value is the file name of the script in the tsp_dir/template directory
39 # The script will be executed after the TSP session is completed. The script
40 # is configuring the tunnel interface and routes.
41 # checktunnel is only printing information and does not configure any tunnel
42 -# freebsd is for FreeBSD 4.X and above
43 -# netbsd is for NetBSD 1.6 and above
44 -# linux is for Linux (most distributions)
45 -# windows is for WindowsXP
46 -# darwin is for MacOS X 10.2 and above
47 -# cisco is for Cisco IOS. This script prints the cisco configuration while
48 -# not configuring the cisco itself.
49 -# solaris is for Solaris 8 and above.
50 -# openbsd is for OpenBSD 3.X and above
51 +# setup will do the actual work
52 # you could customize your own script, name it and put the filename in
53 # the template variable.
54 # on unix, '.sh' is added to the name of the script.
55 # on windows, '.bat' is added to the name of the script.
61 # 'server' is the tunnel broker identifier
62 diff -Nur tspc2/platform/linux/tsp_local.c tspc2.owrt/platform/linux/tsp_local.c
63 --- tspc2/platform/linux/tsp_local.c 2004-07-07 21:25:47.000000000 +0200
64 +++ tspc2.owrt/platform/linux/tsp_local.c 2007-02-19 16:07:18.000000000 +0100
67 /* these globals are defined by US used by alot of things in */
69 -char *FileName = "tspc.conf";
70 -char *LogFile = "tspc.log";
71 +char *FileName = "/etc/tsp/tspc.conf";
72 +char *LogFile = "/var/log/tspc.log";
73 char *LogFileName = NULL;
74 -char *ScriptInterpretor = "/bin/sh";
75 +char *ScriptInterpretor = "";
76 char *ScriptExtension = "sh";
77 char *ScriptDir = NULL;
78 -char *TspHomeDir = "/usr/local/etc/tsp";
79 +char *TspHomeDir = "/etc/tsp";
80 char DirSeparator = '/';
87 - Display(0, ELInfo, "tspStartLocal", "Going daemon, check %s for tunnel creation status", LogFile);
88 + Display(1, ELInfo, "tspStartLocal", "Going daemon, check %s for tunnel creation status", LogFile);
90 if (daemon(0,0) == -1) {
91 Display(1, ELError, "tspStartLocal", "Unable to fork.");
92 diff -Nur tspc2/src/lib/config.c tspc2.owrt/src/lib/config.c
93 --- tspc2/src/lib/config.c 2004-06-29 17:06:13.000000000 +0200
94 +++ tspc2.owrt/src/lib/config.c 2007-02-19 16:07:11.000000000 +0100
96 if(IsPresent(Conf->dns_server)) {
98 char *dns = strdup(Conf->dns_server);
99 + struct addrinfo *contact;
100 if (eq(Conf->host_type, "host")) {
101 Display(1,ELError, "tspVerifyConfig", "DNS delegation is not supported for host_type=host");
104 for(Server = strtok(dns, ":");Server; Server = strtok(NULL, ":")) {
105 - if(gethostbyname(Server) == NULL) {
106 + if(getaddrinfo(Server, "domain", 0, &contact)!=0) {
107 Display(1,ELError, "tspVerifyConfig", "DNS server name %s is not resolving.", Server);
110 + freeaddrinfo(contact);
114 diff -Nur tspc2/src/tsp/tsp_client.c tspc2.owrt/src/tsp/tsp_client.c
115 --- tspc2/src/tsp/tsp_client.c 2004-04-20 17:10:58.000000000 +0200
116 +++ tspc2.owrt/src/tsp/tsp_client.c 2007-02-19 16:07:18.000000000 +0100
121 - Display(0, ELInfo, "tspSetupTunnel", "Got tunnel parameters from server, setting up local tunnel");
122 + Display(1, ELInfo, "tspSetupTunnel", "Got tunnel parameters from server, setting up local tunnel");
124 /* and start the show */
125 ret = tspStartLocal(socket, conf, &t, nt[conf->transport]);
127 LogInit("tspc", LogFile);
129 Display( 1, ELInfo, "tspMain", "----- TSP Client Version %s Initializing -------------------------", TSP_CLIENT_VERSION);
130 - Display( 0, ELInfo, "tspMain", IDENTIFICATION);
131 - Display( 0, ELInfo, "tspMain", "Initializing (use -h for help)\n");
132 + Display( 1, ELInfo, "tspMain", IDENTIFICATION);
133 + Display( 1, ELInfo, "tspMain", "Initializing (use -h for help)\n");
135 if((status = tspInitialize(argc, argv, &c)) != 0) { // *** we have no uninitialize
137 @@ -361,12 +361,12 @@
139 /* first try with RUDP */
140 c.transport = NET_TOOLS_T_RUDP;
141 - Display( 0, ELInfo, "tspMain", "\nConnecting to server with reliable udp");
142 + Display( 1, ELInfo, "tspMain", "\nConnecting to server with reliable udp");
146 if (c.transport == NET_TOOLS_T_TCP)
147 - Display( 0, ELInfo, "tspMain", "\nConnecting to server with tcp");
148 + Display( 1, ELInfo, "tspMain", "\nConnecting to server with tcp");
150 Display( 1, ELInfo, "tspMain", "Using TSP protocol version %s",
151 TspProtocolVersionStrings[version_index]);
152 diff -Nur tspc2/template/linux.sh tspc2.owrt/template/linux.sh
153 --- tspc2/template/linux.sh 2004-06-23 23:29:20.000000000 +0200
154 +++ tspc2.owrt/template/linux.sh 2007-02-19 16:08:39.000000000 +0100
158 Display 1 "Adding default route"
159 - ExecNoCheck $route -A inet6 del ::/0 2>/dev/null # delete old default route
160 ExecNoCheck $route -A inet6 del 2000::/3 2>/dev/null # delete old gw route
161 - Exec $route -A inet6 add ::/0 dev $TSP_TUNNEL_INTERFACE
162 Exec $route -A inet6 add 2000::/3 dev $TSP_TUNNEL_INTERFACE
166 Display 1 "Kernel setup"
167 if [ X"${TSP_PREFIXLEN}" != X"64" ]; then
168 #Better way on linux to avoid loop with the remaining /48?
169 - $route -A inet6 add $TSP_PREFIX::/$TSP_PREFIXLEN dev $TSP_HOME_INTERFACE 2>/dev/null
170 + ExecNoCheck $route -A inet6 del $TSP_PREFIX::/$TSP_PREFIXLEN dev $TSP_HOME_INTERFACE 2>/dev/null
171 + Exec $route -A inet6 add $TSP_PREFIX::/$TSP_PREFIXLEN dev $TSP_HOME_INTERFACE
173 - Exec $sysctl -w net.ipv6.conf.all.forwarding=1 # ipv6_forwarding enabled
174 + Exec $sysctl -q -w net.ipv6.conf.all.forwarding=1 # ipv6_forwarding enabled
175 Display 1 "Adding prefix to $TSP_HOME_INTERFACE"
176 OLDADDR=`$ifconfig $TSP_HOME_INTERFACE | grep "inet6.* $PREF" | sed -e "s/^.*inet6 addr: //" -e "s/ Scope.*\$//"`
177 if [ ! -z $OLDADDR ]; then
178 @@ -157,28 +156,28 @@
179 Exec $ifconfig $TSP_HOME_INTERFACE inet6 del $OLDADDR
181 Exec $ifconfig $TSP_HOME_INTERFACE add $TSP_PREFIX::1/64
182 - # Router advertisement configuration
183 - Display 1 "Create new $rtadvdconfigfile"
184 - echo "##### rtadvd.conf made by TSP ####" > "$rtadvdconfigfile"
185 - echo "interface $TSP_HOME_INTERFACE" >> "$rtadvdconfigfile"
186 - echo "{" >> "$rtadvdconfigfile"
187 - echo " AdvSendAdvert on;" >> "$rtadvdconfigfile"
188 - echo " prefix $TSP_PREFIX::/64" >> "$rtadvdconfigfile"
189 - echo " {" >> "$rtadvdconfigfile"
190 - echo " AdvOnLink on;" >> "$rtadvdconfigfile"
191 - echo " AdvAutonomous on;" >> "$rtadvdconfigfile"
192 - echo " };" >> "$rtadvdconfigfile"
193 - echo "};" >> "$rtadvdconfigfile"
194 - echo "" >> "$rtadvdconfigfile"
195 - /etc/init.d/radvd stop
196 - if [ -f $rtadvdconfigfile ]; then
197 - KillProcess $rtadvdconfigfile
198 - Exec $rtadvd -u radvd -C $rtadvdconfigfile
199 - Display 1 "Starting radvd: $rtadvd -u radvd -C $rtadvdconfigfile"
201 - echo "Error : file $rtadvdconfigfile not found"
204 +# # Router advertisement configuration
205 +# Display 1 "Create new $rtadvdconfigfile"
206 +# echo "##### rtadvd.conf made by TSP ####" > "$rtadvdconfigfile"
207 +# echo "interface $TSP_HOME_INTERFACE" >> "$rtadvdconfigfile"
208 +# echo "{" >> "$rtadvdconfigfile"
209 +# echo " AdvSendAdvert on;" >> "$rtadvdconfigfile"
210 +# echo " prefix $TSP_PREFIX::/64" >> "$rtadvdconfigfile"
211 +# echo " {" >> "$rtadvdconfigfile"
212 +# echo " AdvOnLink on;" >> "$rtadvdconfigfile"
213 +# echo " AdvAutonomous on;" >> "$rtadvdconfigfile"
214 +# echo " };" >> "$rtadvdconfigfile"
215 +# echo "};" >> "$rtadvdconfigfile"
216 +# echo "" >> "$rtadvdconfigfile"
217 +# /etc/init.d/radvd stop
218 +# if [ -f $rtadvdconfigfile ]; then
219 +# KillProcess $rtadvdconfigfile
220 +# Exec $rtadvd -u radvd -C $rtadvdconfigfile
221 +# Display 1 "Starting radvd: $rtadvd -u radvd -C $rtadvdconfigfile"
223 +# echo "Error : file $rtadvdconfigfile not found"
228 Display 1 "--- End of configuration script. ---"