Changeset 534 for trunk/src/ocattun.c


Ignore:
Timestamp:
11/29/09 22:37:56 (2 years ago)
Author:
eagle
Message:

merged GarliCat branch back into trunk
onioncat-privatehosts.pl added (code by zzz)

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src

  • trunk/src/ocattun.c

    r511 r534  
    2727 
    2828#include "ocat.h" 
     29#include "ocat_netdesc.h" 
    2930 
    3031 
     
    6162      log_msg(LOG_ERR, "could not exec \"%s\": \"%s\"", buf, strerror(errno)); 
    6263 
    63    snprintf(buf, sizeof(buf), "netsh interface ipv6 add route %s/%d \"%s\"", astr, TOR_PREFIX_LEN, dev); 
     64   snprintf(buf, sizeof(buf), "netsh interface ipv6 add route %s/%d \"%s\"", astr, NDESC(prefix_len), dev); 
    6465   log_debug("setting IP routing: \"%s\"", buf); 
    6566   if (system(buf) == -1) 
     
    9293   if (!CNF(use_tap)) 
    9394   { 
    94       snprintf(buf, sizeof(buf), "ifconfig %s add %s/%d up", dev, astr, TOR_PREFIX_LEN); 
     95      snprintf(buf, sizeof(buf), "ifconfig %s add %s/%d up", dev, astr, NDESC(prefix_len)); 
    9596      log_msg(LOG_INFO, "configuring tun IP: \"%s\"", buf); 
    9697      if (system(buf) == -1) 
     
    169170   { 
    170171#ifdef __OpenBSD__ 
    171       snprintf(buf, sizeof(buf), "ifconfig %s inet6 %s prefixlen %d up", dev, astr, TOR_PREFIX_LEN); 
     172      snprintf(buf, sizeof(buf), "ifconfig %s inet6 %s prefixlen %d up", dev, astr, NDESC(prefix_len)); 
    172173#else 
    173       snprintf(buf, sizeof(buf), "ifconfig %s inet6 %s/%d up", dev, astr, TOR_PREFIX_LEN); 
     174      snprintf(buf, sizeof(buf), "ifconfig %s inet6 %s/%d up", dev, astr, NDESC(prefix_len)); 
    174175#endif 
    175176      log_debug("setting IP on tun: \"%s\"", buf); 
     
    181182      // MacOSX requires the route to be set up manually 
    182183      // FIXME: the prefix shouldn't be hardcoded here 
    183       snprintf(buf, sizeof(buf), "route add -inet6 -net fd87:d87e:eb43:: -prefixlen %d -gateway %s", TOR_PREFIX_LEN, astr); 
     184      snprintf(buf, sizeof(buf), "route add -inet6 -net fd87:d87e:eb43:: -prefixlen %d -gateway %s", NDESC(prefix_len), astr); 
    184185      log_msg(LOG_INFO, "setup routing: \"%s\"", buf); 
    185186      if (system(buf) == -1) 
Note: See TracChangeset for help on using the changeset viewer.