diff -ruN -xversion.c -xconfig.* -xstamp-h -x*.d -x*.o -xMakefile -xTAGS -xautom4te.cache -x*.tab.? -x*.yy.? -xconfigure -x*~ secnet-0.1.16.upstream/Makefile.in secnet-0.1.16.rjk/Makefile.in --- secnet-0.1.16.upstream/Makefile.in Fri Sep 19 15:37:56 2003 +++ secnet-0.1.16.rjk/Makefile.in Sun Nov 7 14:33:58 2004 @@ -36,6 +36,7 @@ #CFLAGS:=-Wall @WRITESTRINGS@ @CFLAGS@ -DHACKY_PARALLEL CFLAGS:=-Wall @WRITESTRINGS@ @CFLAGS@ ALL_CFLAGS:=@DEFS@ -I$(srcdir) -I. $(CFLAGS) +CPPFLAGS:=@CPPFLAGS@ LDFLAGS:=@LDFLAGS@ LDLIBS:=@LIBS@ @@ -117,7 +118,7 @@ $(DEPENDS): ${srcdir}/depend.sh %.d: %.c - ${srcdir}/depend.sh $(srcdir) $(ALL_CFLAGS) $< > $@ + ${srcdir}/depend.sh $(srcdir) $(CPPFLAGS) $(ALL_CFLAGS) $< > $@ -include $(DEPENDS) Binary files secnet-0.1.16.upstream/ktrace.out and secnet-0.1.16.rjk/ktrace.out differ diff -ruN -xversion.c -xconfig.* -xstamp-h -x*.d -x*.o -xMakefile -xTAGS -xautom4te.cache -x*.tab.? -x*.yy.? -xconfigure -x*~ secnet-0.1.16.upstream/netlink.c secnet-0.1.16.rjk/netlink.c --- secnet-0.1.16.upstream/netlink.c Sat Aug 24 18:03:35 2002 +++ secnet-0.1.16.rjk/netlink.c Tue Nov 9 23:06:55 2004 @@ -148,25 +148,24 @@ static inline uint16_t ip_fast_csum(uint8_t *iph, uint32_t ihl) { uint32_t sum; - __asm__ __volatile__(" - movl (%1), %0 - subl $4, %2 - jbe 2f - addl 4(%1), %0 - adcl 8(%1), %0 - adcl 12(%1), %0 -1: adcl 16(%1), %0 - lea 4(%1), %1 - decl %2 - jne 1b - adcl $0, %0 - movl %0, %2 - shrl $16, %0 - addw %w2, %w0 - adcl $0, %0 - notl %0 -2: - " + __asm__ __volatile__( +" movl (%1), %0\n" +" subl $4, %2\n" +" jbe 2f\n" +" addl 4(%1), %0\n" +" adcl 8(%1), %0\n" +" adcl 12(%1), %0\n" +"1: adcl 16(%1), %0\n" +" lea 4(%1), %1\n" +" decl %2\n" +" jne 1b\n" +" adcl $0, %0\n" +" movl %0, %2\n" +" shrl $16, %0\n" +" addw %w2, %w0\n" +" adcl $0, %0\n" +" notl %0\n" +"2:\n" /* Since the input registers which are loaded with iph and ipl are modified, we must also specify them as outputs, or gcc will assume they contain their original values. */ @@ -498,18 +497,19 @@ netlink_icmp_simple(st,buf,client,ICMP_TYPE_UNREACHABLE, ICMP_CODE_NET_PROHIBITED); BUF_FREE(buf); - } - if (best_quality>0) { - /* XXX Fragment if required */ - st->routes[best_match]->deliver( - st->routes[best_match]->dst, buf); - st->routes[best_match]->outcount++; - BUF_ASSERT_FREE(buf); } else { - /* Generate ICMP destination unreachable */ - netlink_icmp_simple(st,buf,client,ICMP_TYPE_UNREACHABLE, - ICMP_CODE_NET_UNREACHABLE); /* client==NULL */ - BUF_FREE(buf); + if (best_quality>0) { + /* XXX Fragment if required */ + st->routes[best_match]->deliver( + st->routes[best_match]->dst, buf); + st->routes[best_match]->outcount++; + BUF_ASSERT_FREE(buf); + } else { + /* Generate ICMP destination unreachable */ + netlink_icmp_simple(st,buf,client,ICMP_TYPE_UNREACHABLE, + ICMP_CODE_NET_UNREACHABLE); /* client==NULL */ + BUF_FREE(buf); + } } } BUF_ASSERT_FREE(buf); @@ -721,14 +721,15 @@ for (i=0; in_clients; i++) { netlink_output_subnets(st,c,st->routes[i]->subnets); Message(c,"-> tunnel %s (%s,mtu %d,%s routes,%s," - "quality %d,use %d)\n", + "quality %d,use %d,pri %lu)\n", st->routes[i]->name, st->routes[i]->up?"up":"down", st->routes[i]->mtu, st->routes[i]->options&OPT_SOFTROUTE?"soft":"hard", st->routes[i]->options&OPT_ALLOWROUTE?"free":"restricted", st->routes[i]->link_quality, - st->routes[i]->outcount); + st->routes[i]->outcount, + (unsigned long)st->routes[i]->priority); } net=ipaddr_to_string(st->secnet_address); Message(c,"%s/32 -> netlink \"%s\" (use %d)\n", Binary files secnet-0.1.16.upstream/secnet and secnet-0.1.16.rjk/secnet differ diff -ruN -xversion.c -xconfig.* -xstamp-h -x*.d -x*.o -xMakefile -xTAGS -xautom4te.cache -x*.tab.? -x*.yy.? -xconfigure -x*~ secnet-0.1.16.upstream/secnet.h secnet-0.1.16.rjk/secnet.h --- secnet-0.1.16.upstream/secnet.h Thu May 1 12:00:40 2003 +++ secnet-0.1.16.rjk/secnet.h Sun Nov 7 14:25:21 2004 @@ -287,6 +287,8 @@ /* LOG interface */ +#define log secnet_log /* conflict with math.h */ + typedef void log_msg_fn(void *st, int class, const char *message, ...); typedef void log_vmsg_fn(void *st, int class, const char *message, va_list args); diff -ruN -xversion.c -xconfig.* -xstamp-h -x*.d -x*.o -xMakefile -xTAGS -xautom4te.cache -x*.tab.? -x*.yy.? -xconfigure -x*~ secnet-0.1.16.upstream/tun.c secnet-0.1.16.rjk/tun.c --- secnet-0.1.16.upstream/tun.c Fri Feb 22 00:51:05 2002 +++ secnet-0.1.16.rjk/tun.c Sun Nov 7 15:48:49 2004 @@ -190,7 +190,8 @@ break; case TUN_CONFIG_IOCTL: { -#ifdef HAVE_NET_ROUTE_H + /* darwin rtentry has a different format, use /sbin/route instead */ +#if HAVE_NET_ROUTE_H && ! __APPLE__ struct rtentry rt; struct sockaddr_in *sa; int action; @@ -353,7 +354,7 @@ hostaddr,secnetaddr,"mtu",mtu,"up",(char *)0); break; case TUN_CONFIG_IOCTL: -#ifdef HAVE_NET_IF_H +#if HAVE_NET_IF_H && ! __APPLE__ { int fd; struct ifreq ifr; @@ -486,7 +487,8 @@ } } else if (strcmp(u.sysname,"SunOS")==0) { st->tun_flavour=TUN_FLAVOUR_STREAMS; - } else if (strcmp(u.sysname,"FreeBSD")==0) { + } else if (strcmp(u.sysname,"FreeBSD")==0 + || strcmp(u.sysname,"Darwin")==0) { st->tun_flavour=TUN_FLAVOUR_BSD; } } @@ -501,9 +503,13 @@ st->ifconfig_type=TUN_CONFIG_IOCTL; break; case TUN_FLAVOUR_BSD: +#if __linux__ /* XXX on Linux we still want TUN_CONFIG_IOCTL. Perhaps we can use this on BSD too. */ st->ifconfig_type=TUN_CONFIG_IOCTL; +#else + st->ifconfig_type=TUN_CONFIG_BSD; +#endif break; case TUN_FLAVOUR_STREAMS: st->ifconfig_type=TUN_CONFIG_BSD;