~ubuntu-branches/ubuntu/precise/iptables/precise-proposed

« back to all changes in this revision

Viewing changes to extensions/libipt_LOG.c

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2009-07-14 15:59:54 UTC
  • mfrom: (5.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20090714155954-9039kro8cnh6lb1q
Tags: 1.4.4-1ubuntu1
* Merge from debian unstable, remaining changes: LP: #399211
  - Don't fail to run iptables-save if iptables module isn't loaded.
  - debian/patches/0901-build-libipq_pic.a.patch - Build libipq_pic.a with
    -fPIC. Upstream changed build system and patch modified accordingly.
  - Revert changes between 1.4.1.1-3 and 1.4.1.1-4, thus bringing back
    the howtos.
  - Added linuxdoc-tools to Build-Depends
  - Modified debian/iptables{,-dev}.install to match DM syntax
    (removed debian/tmp)

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
        if (!xtables_strtoui(level, NULL, &lev, 0, 7)) {
73
73
                unsigned int i = 0;
74
74
 
75
 
                for (i = 0;
76
 
                     i < sizeof(ipt_log_names) / sizeof(struct ipt_log_names);
77
 
                     i++) {
 
75
                for (i = 0; i < ARRAY_SIZE(ipt_log_names); ++i)
78
76
                        if (strncasecmp(level, ipt_log_names[i].name,
79
77
                                        strlen(level)) == 0) {
80
78
                                if (set++)
83
81
                                                   level);
84
82
                                lev = ipt_log_names[i].level;
85
83
                        }
86
 
                }
87
84
 
88
85
                if (!set)
89
86
                        xtables_error(PARAMETER_PROBLEM,
201
198
                printf("flags %u level %u ",
202
199
                       loginfo->logflags, loginfo->level);
203
200
        else {
204
 
                for (i = 0;
205
 
                     i < sizeof(ipt_log_names) / sizeof(struct ipt_log_names);
206
 
                     i++) {
 
201
                for (i = 0; i < ARRAY_SIZE(ipt_log_names); ++i)
207
202
                        if (loginfo->level == ipt_log_names[i].level) {
208
203
                                printf("level %s ", ipt_log_names[i].name);
209
204
                                break;
210
205
                        }
211
 
                }
212
 
                if (i == sizeof(ipt_log_names) / sizeof(struct ipt_log_names))
 
206
                if (i == ARRAY_SIZE(ipt_log_names))
213
207
                        printf("UNKNOWN level %u ", loginfo->level);
214
208
                if (loginfo->logflags & IPT_LOG_TCPSEQ)
215
209
                        printf("tcp-sequence ");