]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
ipp2p: use OR in flag settings in libxt_ipp2p
authorJan Engelhardt <jengelh@computergmbh.de>
Thu, 27 Mar 2008 07:21:49 +0000 (08:21 +0100)
committerJan Engelhardt <jengelh@computergmbh.de>
Tue, 8 Apr 2008 18:34:05 +0000 (20:34 +0200)
extensions/libxt_ipp2p.c

index b34ffc29764451c1f405726892e3d950df196e7b..f2c7c4559ec78e3efc5fc67ef0cd310569319b12 100644 (file)
@@ -68,8 +68,8 @@ static int ipp2p_mt_parse(int c, char **argv, int invert, unsigned int *flags,
                exit_error(PARAMETER_PROBLEM,
                                "ipp2p: use `--edk' OR `--edk-data' but not both of them!");
                if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
-               *flags += IPP2P_EDK;
-               info->cmd = *flags;
+               *flags    |= IPP2P_EDK;
+               info->cmd |= IPP2P_EDK;
                break;
 
        case '7':               /*cmd: dc*/
@@ -81,8 +81,8 @@ static int ipp2p_mt_parse(int c, char **argv, int invert, unsigned int *flags,
                exit_error(PARAMETER_PROBLEM,
                                "ipp2p: use `--dc' OR `--dc-data' but not both of them!");
                if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
-               *flags += IPP2P_DC;
-               info->cmd = *flags;
+               *flags    |= IPP2P_DC;
+               info->cmd |= IPP2P_DC;
                break;
 
        case '9':               /*cmd: gnu*/
@@ -94,8 +94,8 @@ static int ipp2p_mt_parse(int c, char **argv, int invert, unsigned int *flags,
                exit_error(PARAMETER_PROBLEM,
                                "ipp2p: use `--gnu' OR `--gnu-data' but not both of them!");
                if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
-               *flags += IPP2P_GNU;
-               info->cmd = *flags;
+               *flags    |= IPP2P_GNU;
+               info->cmd |= IPP2P_GNU;
                break;
 
        case 'a':               /*cmd: kazaa*/
@@ -107,8 +107,8 @@ static int ipp2p_mt_parse(int c, char **argv, int invert, unsigned int *flags,
                exit_error(PARAMETER_PROBLEM,
                                "ipp2p: use `--kazaa' OR `--kazaa-data' but not both of them!");
                if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
-               *flags += IPP2P_KAZAA;
-               info->cmd = *flags;
+               *flags    |= IPP2P_KAZAA;
+               info->cmd |= IPP2P_KAZAA;
                break;
 
        case 'b':               /*cmd: bit*/
@@ -116,8 +116,8 @@ static int ipp2p_mt_parse(int c, char **argv, int invert, unsigned int *flags,
                exit_error(PARAMETER_PROBLEM,
                                "ipp2p: `--bit' may only be "
                                "specified once!");
-               *flags += IPP2P_BIT;
-               info->cmd = *flags;
+               *flags    |= IPP2P_BIT;
+               info->cmd |= IPP2P_BIT;
                break;
 
        case 'c':               /*cmd: apple*/
@@ -126,8 +126,8 @@ static int ipp2p_mt_parse(int c, char **argv, int invert, unsigned int *flags,
                                "ipp2p: `--apple' may only be "
                                "specified once!");
                if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
-               *flags += IPP2P_APPLE;
-               info->cmd = *flags;
+               *flags    |= IPP2P_APPLE;
+               info->cmd |= IPP2P_APPLE;
                break;
 
        case 'd':               /*cmd: soul*/
@@ -136,8 +136,8 @@ static int ipp2p_mt_parse(int c, char **argv, int invert, unsigned int *flags,
                                "ipp2p: `--soul' may only be "
                                "specified once!");
                if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
-               *flags += IPP2P_SOUL;
-               info->cmd = *flags;
+               *flags    |= IPP2P_SOUL;
+               info->cmd |= IPP2P_SOUL;
                break;
 
        case 'e':               /*cmd: winmx*/
@@ -146,8 +146,8 @@ static int ipp2p_mt_parse(int c, char **argv, int invert, unsigned int *flags,
                                "ipp2p: `--winmx' may only be "
                                "specified once!");
                if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
-               *flags += IPP2P_WINMX;
-               info->cmd = *flags;
+               *flags    |= IPP2P_WINMX;
+               info->cmd |= IPP2P_WINMX;
                break;
 
        case 'f':               /*cmd: ares*/
@@ -156,8 +156,8 @@ static int ipp2p_mt_parse(int c, char **argv, int invert, unsigned int *flags,
                                "ipp2p: `--ares' may only be "
                                "specified once!");
                if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
-               *flags += IPP2P_ARES;
-               info->cmd = *flags;
+               *flags    |= IPP2P_ARES;
+               info->cmd |= IPP2P_ARES;
                break;
 
        case 'g':               /*cmd: mute*/
@@ -166,26 +166,28 @@ static int ipp2p_mt_parse(int c, char **argv, int invert, unsigned int *flags,
                                "ipp2p: `--mute' may only be "
                                "specified once!");
                if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
-               *flags += IPP2P_MUTE;
-               info->cmd = *flags;
+               *flags    |= IPP2P_MUTE;
+               info->cmd |= IPP2P_MUTE;
                break;
+
        case 'h':               /*cmd: waste*/
                if ((*flags & IPP2P_WASTE) == IPP2P_WASTE)
                exit_error(PARAMETER_PROBLEM,
                                "ipp2p: `--waste' may only be "
                                "specified once!");
                if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
-               *flags += IPP2P_WASTE;
-               info->cmd = *flags;
+               *flags    |= IPP2P_WASTE;
+               info->cmd |= IPP2P_WASTE;
                break;
+
        case 'i':               /*cmd: xdcc*/
                if ((*flags & IPP2P_XDCC) == IPP2P_XDCC)
                exit_error(PARAMETER_PROBLEM,
                                "ipp2p: `--ares' may only be "
                                "specified once!");
                if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
-               *flags += IPP2P_XDCC;
-               info->cmd = *flags;
+               *flags    |= IPP2P_XDCC;
+               info->cmd |= IPP2P_XDCC;
                break;
 
        case 'j':               /*cmd: debug*/