X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=prometheus.c;h=20a7603d7b4f7f776d96ca48a5a366c5792ccb72;hb=ca6f7e80f4ce05259df01ec965beb7a4907b8540;hp=48384a6a16fa639279e85ef70a0e50f51ce06364;hpb=d7357b63c9942c72481993bdb9632861c1d83a55;p=svn%2FPrometheus-QoS%2F.git diff --git a/prometheus.c b/prometheus.c index 48384a6..20a7603 100644 --- a/prometheus.c +++ b/prometheus.c @@ -83,6 +83,7 @@ char *mark = "MARK"; char *mark_iptables = "MARK --set-mark "; int dry_run = FALSE; /* preview - use puts() instead of system() */ char *iptablespreamble = "*mangle\n:PREROUTING ACCEPT [0:0]\n:POSTROUTING ACCEPT [0:0]\n:INPUT ACCEPT [0:0]\n:OUTPUT ACCEPT [0:0]\n:FORWARD ACCEPT [0:0]"; +char *ip6preamble = "-A FORWARD -p ipv6-icmp -j ACCEPT\n-A POSTROUTING -p ipv6-icmp -j ACCEPT\n-A FORWARD -s fe80::/10 -j ACCEPT\n-A FORWARD -d ff00::/8 -j ACCEPT\n-A POSTROUTING -s fe80::/10 -j ACCEPT\n-A POSTROUTING -d ff00::/8 -j ACCEPT"; FILE *iptables_file = NULL; FILE *ip6tables_file = NULL; int enable_credit = TRUE; /* enable credit file */ @@ -619,6 +620,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); exit(-1); } iptables_save_line(iptablespreamble, TRUE); + iptables_save_line(ip6preamble, TRUE); } run_iptables_restore(); @@ -628,8 +630,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); { perror(cmdlog); exit(-1); - } - + } sprintf(str,"%s qdisc del dev %s root 2>/dev/null",tc,lan); safe_run(str); @@ -643,6 +644,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); { ip6tables_file=fopen(ip6tablesfile,"w"); iptables_save_line(iptablespreamble, TRUE); + iptables_save_line(ip6preamble, TRUE); } if(qos_free_zone && *qos_free_zone!='0') /* this is currently supported only for IPv4 */ @@ -1046,7 +1048,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); printf("%-22s %-15s mark\n","name","ip"); #endif - printf("Writing %s ... ", classmap); + printf("Writing %s", classmap); f = fopen(classmap, "w"); if(f < 0) { @@ -1054,7 +1056,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); } /*-----------------------------------------------------------------*/ - puts("Generating iptables and tc classes ... "); + printf(" + generating iptables and tc classes ... "); /*-----------------------------------------------------------------*/ for_each(ip, ips) if(ip->mark > 0) /* works only for IPv4 so far */