commit ac0f3519bfc29a1b111b64b7d080f823ce80cb74 Author: Mariusz Mazur <mma...@axeos.com> Date: Fri Apr 11 13:13:30 2014 +0000
rel 3; enhance ipv6 netmask printing ebtables.spec | 4 ++- ipv6_netmask_printing_fix.patch | 54 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) --- diff --git a/ebtables.spec b/ebtables.spec index e874368..d010f75 100644 --- a/ebtables.spec +++ b/ebtables.spec @@ -4,7 +4,7 @@ Summary: Ethernet Bridge Tables Summary(pl.UTF-8): Ethernet Bridge Tables - filtrowanie i translacja adresów dla Ethernetu Name: ebtables Version: %{ver}.%{vermin} -Release: 2 +Release: 3 License: GPL Group: Networking/Daemons Source0: http://downloads.sourceforge.net/ebtables/%{name}-v%{ver}-%{vermin}.tar.gz @@ -14,6 +14,7 @@ Source2: %{name}-config Patch0: ebtables-audit.patch Patch1: ebtables-linkfix.patch Patch2: ebtables-norootinst.patch +Patch3: ipv6_netmask_printing_fix.patch URL: http://ebtables.sourceforge.net/ BuildRequires: rpmbuild(macros) >= 1.268 Requires(post,preun): /sbin/chkconfig @@ -41,6 +42,7 @@ standardowych jąder Linuksa w wersjach 2.5.x i nowszych. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build %{__make} \ diff --git a/ipv6_netmask_printing_fix.patch b/ipv6_netmask_printing_fix.patch new file mode 100644 index 0000000..c96f6ea --- /dev/null +++ b/ipv6_netmask_printing_fix.patch @@ -0,0 +1,54 @@ +diff --git a/extensions/ebt_ip6.c b/extensions/ebt_ip6.c +index 0465e77..52a8448 100644 +--- a/extensions/ebt_ip6.c ++++ b/extensions/ebt_ip6.c +@@ -445,14 +445,14 @@ static void print(const struct ebt_u_entry *entry, + if (ipinfo->invflags & EBT_IP6_SOURCE) + printf("! "); + printf("%s", ebt_ip6_to_numeric(&ipinfo->saddr)); +- printf("/%s ", ebt_ip6_to_numeric(&ipinfo->smsk)); ++ printf("%s ", ebt_ip6_mask_to_string(&ipinfo->smsk)); + } + if (ipinfo->bitmask & EBT_IP6_DEST) { + printf("--ip6-dst "); + if (ipinfo->invflags & EBT_IP6_DEST) + printf("! "); + printf("%s", ebt_ip6_to_numeric(&ipinfo->daddr)); +- printf("/%s ", ebt_ip6_to_numeric(&ipinfo->dmsk)); ++ printf("%s ", ebt_ip6_mask_to_string(&ipinfo->smsk)); + } + if (ipinfo->bitmask & EBT_IP6_TCLASS) { + printf("--ip6-tclass "); +diff --git a/include/ebtables_u.h b/include/ebtables_u.h +index ab615c1..35a5bcc 100644 +--- a/include/ebtables_u.h ++++ b/include/ebtables_u.h +@@ -303,6 +303,7 @@ char *ebt_mask_to_dotted(uint32_t mask); + void ebt_parse_ip6_address(char *address, struct in6_addr *addr, + struct in6_addr *msk); + char *ebt_ip6_to_numeric(const struct in6_addr *addrp); ++char *ebt_ip6_mask_to_string(const struct in6_addr *msk); + + + int do_command(int argc, char *argv[], int exec_style, +diff --git a/useful_functions.c b/useful_functions.c +index d20b68e..2f73589 100644 +--- a/useful_functions.c ++++ b/useful_functions.c +@@ -411,3 +411,16 @@ char *ebt_ip6_to_numeric(const struct in6_addr *addrp) + static char buf[50+1]; + return (char *)inet_ntop(AF_INET6, addrp, buf, sizeof(buf)); + } ++ ++char *ebt_ip6_mask_to_string(const struct in6_addr *msk) ++{ ++ /* /0000:0000:0000:0000:0000:000.000.000.000 ++ * /0000:0000:0000:0000:0000:0000:0000:0000 */ ++ static char buf[51+1]; ++ if (msk->s6_addr32[0] == 0xFFFFFFFFL && msk->s6_addr32[1] == 0xFFFFFFFFL && ++ msk->s6_addr32[2] == 0xFFFFFFFFL && msk->s6_addr32[3] == 0xFFFFFFFFL) ++ *buf = '\0'; ++ else ++ sprintf(buf, "/%s", ebt_ip6_to_numeric(msk)); ++ return buf; ++} ================================================================ ---- gitweb: http://git.pld-linux.org/gitweb.cgi/packages/ebtables.git/commitdiff/ac0f3519bfc29a1b111b64b7d080f823ce80cb74 _______________________________________________ pld-cvs-commit mailing list pld-cvs-commit@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit