Skip to content

Commit

Permalink
[NETFILTER]: Nicer names for ipt_connbytes constants
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Aug 29, 2005
1 parent 8ffde67 commit 25ed891
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions include/linux/netfilter_ipv4/ipt_connbytes.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#define _IPT_CONNBYTES_H

enum ipt_connbytes_what {
IPT_CONNBYTES_WHAT_PKTS,
IPT_CONNBYTES_WHAT_BYTES,
IPT_CONNBYTES_WHAT_AVGPKT,
IPT_CONNBYTES_PKTS,
IPT_CONNBYTES_BYTES,
IPT_CONNBYTES_AVGPKT,
};

enum ipt_connbytes_direction {
Expand Down
12 changes: 6 additions & 6 deletions net/ipv4/netfilter/ipt_connbytes.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ match(const struct sk_buff *skb,
return 0; /* no match */

switch (sinfo->what) {
case IPT_CONNBYTES_WHAT_PKTS:
case IPT_CONNBYTES_PKTS:
switch (sinfo->direction) {
case IPT_CONNBYTES_DIR_ORIGINAL:
what = ct->counters[IP_CT_DIR_ORIGINAL].packets;
Expand All @@ -68,7 +68,7 @@ match(const struct sk_buff *skb,
break;
}
break;
case IPT_CONNBYTES_WHAT_BYTES:
case IPT_CONNBYTES_BYTES:
switch (sinfo->direction) {
case IPT_CONNBYTES_DIR_ORIGINAL:
what = ct->counters[IP_CT_DIR_ORIGINAL].bytes;
Expand All @@ -82,7 +82,7 @@ match(const struct sk_buff *skb,
break;
}
break;
case IPT_CONNBYTES_WHAT_AVGPKT:
case IPT_CONNBYTES_AVGPKT:
switch (sinfo->direction) {
case IPT_CONNBYTES_DIR_ORIGINAL:
what = div64_64(ct->counters[IP_CT_DIR_ORIGINAL].bytes,
Expand Down Expand Up @@ -128,9 +128,9 @@ static int check(const char *tablename,
if (matchsize != IPT_ALIGN(sizeof(struct ipt_connbytes_info)))
return 0;

if (sinfo->what != IPT_CONNBYTES_WHAT_PKTS &&
sinfo->what != IPT_CONNBYTES_WHAT_BYTES &&
sinfo->what != IPT_CONNBYTES_WHAT_AVGPKT)
if (sinfo->what != IPT_CONNBYTES_PKTS &&
sinfo->what != IPT_CONNBYTES_BYTES &&
sinfo->what != IPT_CONNBYTES_AVGPKT)
return 0;

if (sinfo->direction != IPT_CONNBYTES_DIR_ORIGINAL &&
Expand Down

0 comments on commit 25ed891

Please sign in to comment.