summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlaforge <laforge>2002-04-24 09:36:30 +0000
committerlaforge <laforge>2002-04-24 09:36:30 +0000
commit2ad610eaf8636916ec926c591220ff4b4ed73e18 (patch)
tree6e9caf127a443fb14f1cd8a2a66fd1ac6d637cb5
parented0187218221bcff549d92f1d52f292f88eb3466 (diff)
Some ipv6 fixes by kisza:
AH save function fix (problem with --len ! 0) FRAG help fix FRAG save and prtint fix (problem with --len [!] 0)
-rw-r--r--extensions/libip6t_ah.c2
-rw-r--r--extensions/libip6t_frag.c25
2 files changed, 9 insertions, 18 deletions
diff --git a/extensions/libip6t_ah.c b/extensions/libip6t_ah.c
index f169659..e778557 100644
--- a/extensions/libip6t_ah.c
+++ b/extensions/libip6t_ah.c
@@ -203,7 +203,7 @@ static void save(const struct ip6t_ip6 *ip, const struct ip6t_entry_match *match
ahinfo->spis[0]);
}
- if (ahinfo->hdrlen != 0 ) {
+ if (ahinfo->hdrlen != 0 || (ahinfo->invflags & IP6T_AH_INV_LEN) ) {
printf("--ahlen %s%u ",
(ahinfo->invflags & IP6T_AH_INV_LEN) ? "! " : "",
ahinfo->hdrlen);
diff --git a/extensions/libip6t_frag.c b/extensions/libip6t_frag.c
index aabb334..f388201 100644
--- a/extensions/libip6t_frag.c
+++ b/extensions/libip6t_frag.c
@@ -17,7 +17,7 @@ help(void)
" --fragid [!] id[:id] match the id (range)\n"
" --fraglen [!] length total length of this header\n"
" --fragres check the reserved filed, too\n"
-" --fragfirst matches on the frst fragment\n"
+" --fragfirst matches on the first fragment\n"
" [--fragmore|--fraglast] there are more fragments or this\n"
" is the last one\n",
NETFILTER_VERSION);
@@ -184,19 +184,6 @@ print_ids(const char *name, u_int32_t min, u_int32_t max,
}
}
-static void
-print_len(const char *name, u_int32_t len, int invert)
-{
- const char *inv = invert ? "!" : "";
-
- if (len != 0 || invert) {
- printf("%s", name);
- printf(":%s", inv);
- printf("%u", len);
- printf(" ");
- }
-}
-
/* Prints out the union ip6t_matchinfo. */
static void
print(const struct ip6t_ip6 *ip,
@@ -207,8 +194,12 @@ print(const struct ip6t_ip6 *ip,
printf("frag ");
print_ids("id", frag->ids[0], frag->ids[1],
frag->invflags & IP6T_FRAG_INV_IDS);
- print_len("length", frag->hdrlen,
- frag->invflags & IP6T_FRAG_INV_LEN);
+ if (frag->flags & IP6T_FRAG_LEN) {
+ printf("length");
+ printf(":%s", frag->invflags & IP6T_FRAG_INV_LEN ? "!" : "");
+ printf("%u", frag->hdrlen);
+ printf(" ");
+ }
if (frag->flags & IP6T_FRAG_RES) printf("reserved ");
if (frag->flags & IP6T_FRAG_FST) printf("first ");
if (frag->flags & IP6T_FRAG_MF) printf("more ");
@@ -237,7 +228,7 @@ static void save(const struct ip6t_ip6 *ip, const struct ip6t_entry_match *match
fraginfo->ids[0]);
}
- if (fraginfo->hdrlen != 0 ) {
+ if (fraginfo->flags & IP6T_FRAG_LEN) {
printf("--fraglen %s%u ",
(fraginfo->invflags & IP6T_FRAG_INV_LEN) ? "! " : "",
fraginfo->hdrlen);