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

« back to all changes in this revision

Viewing changes to extensions/libxt_tcp.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:
86
86
 
87
87
        for (ptr = strtok(buffer, ","); ptr; ptr = strtok(NULL, ",")) {
88
88
                unsigned int i;
89
 
                for (i = 0;
90
 
                     i < sizeof(tcp_flag_names)/sizeof(struct tcp_flag_names);
91
 
                     i++) {
 
89
                for (i = 0; i < ARRAY_SIZE(tcp_flag_names); ++i)
92
90
                        if (strcasecmp(tcp_flag_names[i].name, ptr) == 0) {
93
91
                                ret |= tcp_flag_names[i].flag;
94
92
                                break;
95
93
                        }
96
 
                }
97
 
                if (i == sizeof(tcp_flag_names)/sizeof(struct tcp_flag_names))
 
94
                if (i == ARRAY_SIZE(tcp_flag_names))
98
95
                        xtables_error(PARAMETER_PROBLEM,
99
96
                                   "Unknown TCP flag `%s'", ptr);
100
 
                }
 
97
        }
101
98
 
102
99
        free(buffer);
103
100
        return ret;