Changeset 964
- Timestamp:
- 02/23/06 11:16:16 (3 years ago)
- Files:
-
- trunk/wifidog/ChangeLog (modified) (1 diff)
- trunk/wifidog/src/fw_iptables.c (modified) (2 diffs)
- trunk/wifidog/src/util.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wifidog/ChangeLog
r944 r964 1 1 # $Id$ 2 2006-02-23 Philippe April <philippe@ilesansfil.org> 3 * src/fw_iptables.c: 4 * Changed order in the filter.FORWARD chain 5 * Added TCPMSS rule 6 * Fixed deleting the rules on shutdown 7 2 8 2006-02-06 Benoit Gr�ire <bock@step.polymtl.ca> 3 9 * src/fw_iptables.c: Fix deleting the rules on shutdown. trunk/wifidog/src/fw_iptables.c
r944 r964 265 265 266 266 /* Assign links and rules to these new chains */ 267 iptables_do_command("-t filter -A FORWARD -i %s -j " TABLE_WIFIDOG_WIFI_TO_INTERNET, gw_interface); 267 268 /* Insert at the beginning */ 269 iptables_do_command("-t filter -I FORWARD -i %s -j " TABLE_WIFIDOG_WIFI_TO_INTERNET, gw_interface); 270 271 /* TCPMSS rule for PPPoE */ 272 iptables_do_command("-t filter -A FORWARD -m state --state INVALID -j DROP"); 273 iptables_do_command("-t filter -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT"); 274 iptables_do_command("-t filter -A FORWARD -i %s -m state --state NEW,INVALID -j DROP", gw_interface); 275 iptables_do_command("-t filter -A FORWARD -o %s -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu", gw_interface); 276 268 277 iptables_do_command("-t filter -A " TABLE_WIFIDOG_WIFI_TO_INTERNET " -j " TABLE_WIFIDOG_AUTHSERVERS); 269 278 iptables_fw_set_authservers(); … … 336 345 iptables_do_command("-t nat -X " TABLE_WIFIDOG_WIFI_TO_ROUTER); 337 346 iptables_do_command("-t nat -X " TABLE_WIFIDOG_WIFI_TO_INTERNET); 347 iptables_do_command("-t nat -X " TABLE_WIFIDOG_GLOBAL); 338 348 iptables_do_command("-t nat -X " TABLE_WIFIDOG_UNKNOWN); 339 349 trunk/wifidog/src/util.c
r935 r964 217 217 } 218 218 219 char *get_gw_iface (void) { 220 #ifdef __linux__ 221 FILE *input; 222 char *device, *gw; 223 224 device = (char *)malloc(16); 225 gw = (char *)malloc(16); 226 227 input = fopen("/proc/net/route", "r"); 228 while (!feof(input)) { 229 fscanf(input, "%s %s %*s %*s %*s %*s %*s %*s %*s %*s %*s\n", device, gw); 230 if (strcmp(gw, "00000000") == 0) { 231 free(gw); 232 return device; 233 } 234 } 235 fclose(input); 236 237 free(device); 238 free(gw); 239 #endif 240 return NULL; 241 } 242 219 243 void mark_online() { 220 244 int before;
