]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
psd: style: remove braces for single statements in ifs
authorJan Engelhardt <jengelh@medozas.de>
Sun, 16 Aug 2009 10:40:44 +0000 (12:40 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Sun, 16 Aug 2009 10:40:44 +0000 (12:40 +0200)
extensions/libxt_psd.c
extensions/xt_psd.c

index 99ee99b0a0f900cc83a1c64cfe4bb0f353559753..88510d0643e2fc5fcc4123f9f59c44c4962cb88a 100644 (file)
@@ -70,53 +70,45 @@ static int psd_mt_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
                /* PSD-weight-threshold */
                case '1':
-                       if(*flags & XT_PSD_OPT_CTRESH) {
+                       if (*flags & XT_PSD_OPT_CTRESH)
                                xtables_error(PARAMETER_PROBLEM,"Can't specify --psd-weight-threshold twice");
-                       }
-                       if(!xtables_strtoui(optarg, NULL,&num,0,PSD_MAX_RATE)) {
+                       if (!xtables_strtoui(optarg, NULL, &num, 0, PSD_MAX_RATE))
                                xtables_error(PARAMETER_PROBLEM, "bad --psd-weight-threshold '%s'", optarg);
-               }
                        psdinfo->weight_threshold = num;
                        *flags |= XT_PSD_OPT_CTRESH;
                        return true;
 
                /* PSD-delay-threshold */
                case '2':
-                       if(*flags & XT_PSD_OPT_DTRESH) {
+                       if (*flags & XT_PSD_OPT_DTRESH)
                                xtables_error(PARAMETER_PROBLEM, "Can't specify --psd-delay-threshold twice");
-                       }
-               if(!xtables_strtoui(optarg, NULL,&num,0,PSD_MAX_RATE)) {
-                       xtables_error(PARAMETER_PROBLEM,"bad --psd-delay-threshold '%s'", optarg);
-               }
+                       if (!xtables_strtoui(optarg, NULL, &num, 0, PSD_MAX_RATE))
+                               xtables_error(PARAMETER_PROBLEM, "bad --psd-delay-threshold '%s'", optarg);
                        psdinfo->delay_threshold = num;
                        *flags |= XT_PSD_OPT_DTRESH;
                        return true;
 
                /* PSD-lo-ports-weight */
                case '3':
-                       if(*flags & XT_PSD_OPT_LPWEIGHT) {
+                       if (*flags & XT_PSD_OPT_LPWEIGHT)
                                xtables_error(PARAMETER_PROBLEM, "Can't specify --psd-lo-ports-weight twice");
-                       }
-                       if(!xtables_strtoui(optarg, NULL,&num,0,PSD_MAX_RATE)) {
-                               xtables_error(PARAMETER_PROBLEM,"bad --psd-lo-ports-weight '%s'", optarg);
-                       }
+                       if (!xtables_strtoui(optarg, NULL, &num, 0, PSD_MAX_RATE))
+                               xtables_error(PARAMETER_PROBLEM, "bad --psd-lo-ports-weight '%s'", optarg);
                        psdinfo->lo_ports_weight = num;
                        *flags |= XT_PSD_OPT_LPWEIGHT;
                        return true;
 
                /* PSD-hi-ports-weight */
                case '4':
-                       if(*flags & XT_PSD_OPT_HPWEIGHT) {
+                       if (*flags & XT_PSD_OPT_HPWEIGHT)
                                xtables_error(PARAMETER_PROBLEM, "Can't specify --psd-hi-ports-weight twice");
-                       }
-                       if(!xtables_strtoui(optarg, NULL, &num, 0, PSD_MAX_RATE)) {
+                       if (!xtables_strtoui(optarg, NULL, &num, 0, PSD_MAX_RATE))
                                xtables_error(PARAMETER_PROBLEM, "bad --psd-hi-ports-weight '%s'", optarg);
-               }
                        psdinfo->hi_ports_weight = num;
                        *flags |= XT_PSD_OPT_HPWEIGHT;
                        return true;
-               }
-               return false;
+       }
+       return false;
 }
 
 /* Final check; nothing. */
index dc61cf6986946633df48a88b0175de783bfe42eb..49a6118d7e7904b796c01797bf1b25ca1e16e74a 100644 (file)
@@ -139,12 +139,10 @@ xt_psd_match(const struct sk_buff *pskb, const struct xt_match_param *match)
        src_port = tcph->source;
        dest_port = tcph->dest;
 
-       if (proto == IPPROTO_TCP) {
+       if (proto == IPPROTO_TCP)
                tcp_flags = *((u_int8_t*)tcph + 13);
-       }
-       else {
+       else
                tcp_flags = 0x00;
-       }
 
        /* We're using IP address 0.0.0.0 for a special purpose here, so don't let
         * them spoof us. [DHCP needs this feature - HW] */