Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 265460 | Differences between
and this patch

Collapse All | Expand All

(-)libipt_ipp2p.c.orig (-49 / +49 lines)
Lines 85-123 Link Here
85
    switch (c) {
85
    switch (c) {
86
	case '1':		/*cmd: ipp2p*/
86
	case '1':		/*cmd: ipp2p*/
87
	    if ((*flags & SHORT_HAND_IPP2P) == SHORT_HAND_IPP2P)
87
	    if ((*flags & SHORT_HAND_IPP2P) == SHORT_HAND_IPP2P)
88
		    exit_error(PARAMETER_PROBLEM,
88
		    xtables_error(PARAMETER_PROBLEM,
89
				"ipp2p: `--ipp2p' may only be "
89
				"ipp2p: `--ipp2p' may only be "
90
				"specified once!");
90
				"specified once!");
91
/*	    if ((*flags & SHORT_HAND_DATA) == SHORT_HAND_DATA)
91
/*	    if ((*flags & SHORT_HAND_DATA) == SHORT_HAND_DATA)
92
		    exit_error(PARAMETER_PROBLEM,
92
		    xtables_error(PARAMETER_PROBLEM,
93
				"ipp2p: `--ipp2p-data' may only be "
93
				"ipp2p: `--ipp2p-data' may only be "
94
				"specified alone!");*/
94
				"specified alone!");*/
95
	    if ((*flags) != 0)
95
	    if ((*flags) != 0)
96
		    exit_error(PARAMETER_PROBLEM,
96
		    xtables_error(PARAMETER_PROBLEM,
97
				"ipp2p: `--ipp2p' may only be "
97
				"ipp2p: `--ipp2p' may only be "
98
				"specified alone!");
98
				"specified alone!");
99
	    if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
99
	    if (invert) xtables_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
100
	    *flags += SHORT_HAND_IPP2P;
100
	    *flags += SHORT_HAND_IPP2P;
101
	    info->cmd = *flags;
101
	    info->cmd = *flags;
102
	    break;
102
	    break;
103
	    
103
	    
104
	case '2':		/*cmd: edk*/
104
	case '2':		/*cmd: edk*/
105
	    if ((*flags & IPP2P_EDK) == IPP2P_EDK)
105
	    if ((*flags & IPP2P_EDK) == IPP2P_EDK)
106
		    exit_error(PARAMETER_PROBLEM,
106
		    xtables_error(PARAMETER_PROBLEM,
107
				"ipp2p: `--edk' may only be "
107
				"ipp2p: `--edk' may only be "
108
				"specified once");
108
				"specified once");
109
	    if ((*flags & SHORT_HAND_IPP2P) == SHORT_HAND_IPP2P)
109
	    if ((*flags & SHORT_HAND_IPP2P) == SHORT_HAND_IPP2P)
110
		    exit_error(PARAMETER_PROBLEM,
110
		    xtables_error(PARAMETER_PROBLEM,
111
				"ipp2p: `--ipp2p' may only be "
111
				"ipp2p: `--ipp2p' may only be "
112
				"specified alone!");
112
				"specified alone!");
113
/*	    if ((*flags & SHORT_HAND_DATA) == SHORT_HAND_DATA)
113
/*	    if ((*flags & SHORT_HAND_DATA) == SHORT_HAND_DATA)
114
		    exit_error(PARAMETER_PROBLEM,
114
		    xtables_error(PARAMETER_PROBLEM,
115
				"ipp2p: `--ipp2p-data' may only be "
115
				"ipp2p: `--ipp2p-data' may only be "
116
				"specified alone!");*/
116
				"specified alone!");*/
117
            if ((*flags & IPP2P_DATA_EDK) == IPP2P_DATA_EDK)
117
            if ((*flags & IPP2P_DATA_EDK) == IPP2P_DATA_EDK)
118
            exit_error(PARAMETER_PROBLEM,
118
            xtables_error(PARAMETER_PROBLEM,
119
                                "ipp2p: use `--edk' OR `--edk-data' but not both of them!");
119
                                "ipp2p: use `--edk' OR `--edk-data' but not both of them!");
120
	    if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
120
	    if (invert) xtables_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
121
	    *flags += IPP2P_EDK;
121
	    *flags += IPP2P_EDK;
122
	    info->cmd = *flags;	    
122
	    info->cmd = *flags;	    
123
	    break;
123
	    break;
Lines 125-145 Link Here
125
125
126
	case '7':		/*cmd: dc*/
126
	case '7':		/*cmd: dc*/
127
            if ((*flags & IPP2P_DC) == IPP2P_DC)
127
            if ((*flags & IPP2P_DC) == IPP2P_DC)
128
            exit_error(PARAMETER_PROBLEM,
128
            xtables_error(PARAMETER_PROBLEM,
129
                                "ipp2p: `--dc' may only be "
129
                                "ipp2p: `--dc' may only be "
130
                                "specified once!");
130
                                "specified once!");
131
	    if ((*flags & SHORT_HAND_IPP2P) == SHORT_HAND_IPP2P)
131
	    if ((*flags & SHORT_HAND_IPP2P) == SHORT_HAND_IPP2P)
132
		    exit_error(PARAMETER_PROBLEM,
132
		    xtables_error(PARAMETER_PROBLEM,
133
				"ipp2p: `--ipp2p' may only be "
133
				"ipp2p: `--ipp2p' may only be "
134
				"specified alone!");
134
				"specified alone!");
135
/*	    if ((*flags & SHORT_HAND_DATA) == SHORT_HAND_DATA)
135
/*	    if ((*flags & SHORT_HAND_DATA) == SHORT_HAND_DATA)
136
		    exit_error(PARAMETER_PROBLEM,
136
		    xtables_error(PARAMETER_PROBLEM,
137
				"ipp2p: `--ipp2p-data' may only be "
137
				"ipp2p: `--ipp2p-data' may only be "
138
				"specified alone!");*/
138
				"specified alone!");*/
139
            if ((*flags & IPP2P_DATA_DC) == IPP2P_DATA_DC)
139
            if ((*flags & IPP2P_DATA_DC) == IPP2P_DATA_DC)
140
            exit_error(PARAMETER_PROBLEM,
140
            xtables_error(PARAMETER_PROBLEM,
141
                                "ipp2p: use `--dc' OR `--dc-data' but not both of them!");
141
                                "ipp2p: use `--dc' OR `--dc-data' but not both of them!");
142
	    if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
142
	    if (invert) xtables_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
143
            *flags += IPP2P_DC;
143
            *flags += IPP2P_DC;
144
	    info->cmd = *flags;
144
	    info->cmd = *flags;
145
	    break;
145
	    break;
Lines 147-216 Link Here
147
147
148
	case '9':		/*cmd: gnu*/
148
	case '9':		/*cmd: gnu*/
149
            if ((*flags & IPP2P_GNU) == IPP2P_GNU)
149
            if ((*flags & IPP2P_GNU) == IPP2P_GNU)
150
            exit_error(PARAMETER_PROBLEM,
150
            xtables_error(PARAMETER_PROBLEM,
151
                                "ipp2p: `--gnu' may only be "
151
                                "ipp2p: `--gnu' may only be "
152
                                "specified once!");
152
                                "specified once!");
153
/*	    if ((*flags & SHORT_HAND_DATA) == SHORT_HAND_DATA)
153
/*	    if ((*flags & SHORT_HAND_DATA) == SHORT_HAND_DATA)
154
		    exit_error(PARAMETER_PROBLEM,
154
		    xtables_error(PARAMETER_PROBLEM,
155
				"ipp2p: `--ipp2p-data' may only be "
155
				"ipp2p: `--ipp2p-data' may only be "
156
				"specified alone!");*/
156
				"specified alone!");*/
157
	    if ((*flags & SHORT_HAND_IPP2P) == SHORT_HAND_IPP2P)
157
	    if ((*flags & SHORT_HAND_IPP2P) == SHORT_HAND_IPP2P)
158
		    exit_error(PARAMETER_PROBLEM,
158
		    xtables_error(PARAMETER_PROBLEM,
159
				"ipp2p: `--ipp2p' may only be "
159
				"ipp2p: `--ipp2p' may only be "
160
				"specified alone!");
160
				"specified alone!");
161
            if ((*flags & IPP2P_DATA_GNU) == IPP2P_DATA_GNU)
161
            if ((*flags & IPP2P_DATA_GNU) == IPP2P_DATA_GNU)
162
            exit_error(PARAMETER_PROBLEM,
162
            xtables_error(PARAMETER_PROBLEM,
163
                                "ipp2p: use `--gnu' OR `--gnu-data' but not both of them!");
163
                                "ipp2p: use `--gnu' OR `--gnu-data' but not both of them!");
164
	    if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
164
	    if (invert) xtables_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
165
            *flags += IPP2P_GNU;
165
            *flags += IPP2P_GNU;
166
	    info->cmd = *flags;
166
	    info->cmd = *flags;
167
	    break;
167
	    break;
168
168
169
	case 'a':		/*cmd: kazaa*/
169
	case 'a':		/*cmd: kazaa*/
170
            if ((*flags & IPP2P_KAZAA) == IPP2P_KAZAA)
170
            if ((*flags & IPP2P_KAZAA) == IPP2P_KAZAA)
171
            exit_error(PARAMETER_PROBLEM,
171
            xtables_error(PARAMETER_PROBLEM,
172
                                "ipp2p: `--kazaa' may only be "
172
                                "ipp2p: `--kazaa' may only be "
173
                                "specified once!");
173
                                "specified once!");
174
/*	    if ((*flags & SHORT_HAND_DATA) == SHORT_HAND_DATA)
174
/*	    if ((*flags & SHORT_HAND_DATA) == SHORT_HAND_DATA)
175
		    exit_error(PARAMETER_PROBLEM,
175
		    xtables_error(PARAMETER_PROBLEM,
176
				"ipp2p: `--ipp2p-data' may only be "
176
				"ipp2p: `--ipp2p-data' may only be "
177
				"specified alone!");*/
177
				"specified alone!");*/
178
	    if ((*flags & SHORT_HAND_IPP2P) == SHORT_HAND_IPP2P)
178
	    if ((*flags & SHORT_HAND_IPP2P) == SHORT_HAND_IPP2P)
179
		    exit_error(PARAMETER_PROBLEM,
179
		    xtables_error(PARAMETER_PROBLEM,
180
				"ipp2p: `--ipp2p' may only be "
180
				"ipp2p: `--ipp2p' may only be "
181
				"specified alone!");
181
				"specified alone!");
182
            if ((*flags & IPP2P_DATA_KAZAA) == IPP2P_DATA_KAZAA)
182
            if ((*flags & IPP2P_DATA_KAZAA) == IPP2P_DATA_KAZAA)
183
            exit_error(PARAMETER_PROBLEM,
183
            xtables_error(PARAMETER_PROBLEM,
184
                                "ipp2p: use `--kazaa' OR `--kazaa-data' but not both of them!");
184
                                "ipp2p: use `--kazaa' OR `--kazaa-data' but not both of them!");
185
	    if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
185
	    if (invert) xtables_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
186
            *flags += IPP2P_KAZAA;
186
            *flags += IPP2P_KAZAA;
187
	    info->cmd = *flags;
187
	    info->cmd = *flags;
188
	    break;																											
188
	    break;																											
189
189
190
	case 'b':		/*cmd: bit*/
190
	case 'b':		/*cmd: bit*/
191
            if ((*flags & IPP2P_BIT) == IPP2P_BIT)
191
            if ((*flags & IPP2P_BIT) == IPP2P_BIT)
192
            exit_error(PARAMETER_PROBLEM,
192
            xtables_error(PARAMETER_PROBLEM,
193
                                "ipp2p: `--bit' may only be "
193
                                "ipp2p: `--bit' may only be "
194
                                "specified once!");
194
                                "specified once!");
195
	    if ((*flags & SHORT_HAND_IPP2P) == SHORT_HAND_IPP2P)
195
	    if ((*flags & SHORT_HAND_IPP2P) == SHORT_HAND_IPP2P)
196
		    exit_error(PARAMETER_PROBLEM,
196
		    xtables_error(PARAMETER_PROBLEM,
197
				"ipp2p: `--ipp2p' may only be "
197
				"ipp2p: `--ipp2p' may only be "
198
				"specified alone!");
198
				"specified alone!");
199
	    if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
199
	    if (invert) xtables_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
200
            *flags += IPP2P_BIT;
200
            *flags += IPP2P_BIT;
201
	    info->cmd = *flags;
201
	    info->cmd = *flags;
202
	    break;																											
202
	    break;																											
203
203
204
	case 'c':		/*cmd: apple*/
204
	case 'c':		/*cmd: apple*/
205
            if ((*flags & IPP2P_APPLE) == IPP2P_APPLE)
205
            if ((*flags & IPP2P_APPLE) == IPP2P_APPLE)
206
            exit_error(PARAMETER_PROBLEM,
206
            xtables_error(PARAMETER_PROBLEM,
207
                                "ipp2p: `--apple' may only be "
207
                                "ipp2p: `--apple' may only be "
208
                                "specified once!");
208
                                "specified once!");
209
	    if ((*flags & SHORT_HAND_IPP2P) == SHORT_HAND_IPP2P)
209
	    if ((*flags & SHORT_HAND_IPP2P) == SHORT_HAND_IPP2P)
210
		    exit_error(PARAMETER_PROBLEM,
210
		    xtables_error(PARAMETER_PROBLEM,
211
				"ipp2p: `--ipp2p' may only be "
211
				"ipp2p: `--ipp2p' may only be "
212
				"specified alone!");
212
				"specified alone!");
213
	    if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
213
	    if (invert) xtables_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
214
            *flags += IPP2P_APPLE;
214
            *flags += IPP2P_APPLE;
215
	    info->cmd = *flags;
215
	    info->cmd = *flags;
216
	    break;																											
216
	    break;																											
Lines 218-231 Link Here
218
218
219
	case 'd':		/*cmd: soul*/
219
	case 'd':		/*cmd: soul*/
220
            if ((*flags & IPP2P_SOUL) == IPP2P_SOUL)
220
            if ((*flags & IPP2P_SOUL) == IPP2P_SOUL)
221
            exit_error(PARAMETER_PROBLEM,
221
            xtables_error(PARAMETER_PROBLEM,
222
                                "ipp2p: `--soul' may only be "
222
                                "ipp2p: `--soul' may only be "
223
                                "specified once!");
223
                                "specified once!");
224
	    if ((*flags & SHORT_HAND_IPP2P) == SHORT_HAND_IPP2P)
224
	    if ((*flags & SHORT_HAND_IPP2P) == SHORT_HAND_IPP2P)
225
		    exit_error(PARAMETER_PROBLEM,
225
		    xtables_error(PARAMETER_PROBLEM,
226
				"ipp2p: `--ipp2p' may only be "
226
				"ipp2p: `--ipp2p' may only be "
227
				"specified alone!");
227
				"specified alone!");
228
	    if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
228
	    if (invert) xtables_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
229
            *flags += IPP2P_SOUL;
229
            *flags += IPP2P_SOUL;
230
	    info->cmd = *flags;
230
	    info->cmd = *flags;
231
	    break;																											
231
	    break;																											
Lines 233-299 Link Here
233
233
234
	case 'e':		/*cmd: winmx*/
234
	case 'e':		/*cmd: winmx*/
235
            if ((*flags & IPP2P_WINMX) == IPP2P_WINMX)
235
            if ((*flags & IPP2P_WINMX) == IPP2P_WINMX)
236
            exit_error(PARAMETER_PROBLEM,
236
            xtables_error(PARAMETER_PROBLEM,
237
                                "ipp2p: `--winmx' may only be "
237
                                "ipp2p: `--winmx' may only be "
238
                                "specified once!");
238
                                "specified once!");
239
	    if ((*flags & SHORT_HAND_IPP2P) == SHORT_HAND_IPP2P)
239
	    if ((*flags & SHORT_HAND_IPP2P) == SHORT_HAND_IPP2P)
240
		    exit_error(PARAMETER_PROBLEM,
240
		    xtables_error(PARAMETER_PROBLEM,
241
				"ipp2p: `--ipp2p' may only be "
241
				"ipp2p: `--ipp2p' may only be "
242
				"specified alone!");
242
				"specified alone!");
243
	    if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
243
	    if (invert) xtables_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
244
            *flags += IPP2P_WINMX;
244
            *flags += IPP2P_WINMX;
245
	    info->cmd = *flags;
245
	    info->cmd = *flags;
246
	    break;																											
246
	    break;																											
247
247
248
	case 'f':		/*cmd: ares*/
248
	case 'f':		/*cmd: ares*/
249
            if ((*flags & IPP2P_ARES) == IPP2P_ARES)
249
            if ((*flags & IPP2P_ARES) == IPP2P_ARES)
250
            exit_error(PARAMETER_PROBLEM,
250
            xtables_error(PARAMETER_PROBLEM,
251
                                "ipp2p: `--ares' may only be "
251
                                "ipp2p: `--ares' may only be "
252
                                "specified once!");
252
                                "specified once!");
253
	    if ((*flags & SHORT_HAND_IPP2P) == SHORT_HAND_IPP2P)
253
	    if ((*flags & SHORT_HAND_IPP2P) == SHORT_HAND_IPP2P)
254
		    exit_error(PARAMETER_PROBLEM,
254
		    xtables_error(PARAMETER_PROBLEM,
255
				"ipp2p: `--ipp2p' may only be "
255
				"ipp2p: `--ipp2p' may only be "
256
				"specified alone!");
256
				"specified alone!");
257
	    if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
257
	    if (invert) xtables_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
258
            *flags += IPP2P_ARES;
258
            *flags += IPP2P_ARES;
259
	    info->cmd = *flags;
259
	    info->cmd = *flags;
260
	    break;																											
260
	    break;																											
261
	
261
	
262
	case 'g':		/*cmd: mute*/
262
	case 'g':		/*cmd: mute*/
263
            if ((*flags & IPP2P_MUTE) == IPP2P_MUTE)
263
            if ((*flags & IPP2P_MUTE) == IPP2P_MUTE)
264
            exit_error(PARAMETER_PROBLEM,
264
            xtables_error(PARAMETER_PROBLEM,
265
                                "ipp2p: `--mute' may only be "
265
                                "ipp2p: `--mute' may only be "
266
                                "specified once!");
266
                                "specified once!");
267
	    if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
267
	    if (invert) xtables_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
268
            *flags += IPP2P_MUTE;
268
            *flags += IPP2P_MUTE;
269
	    info->cmd = *flags;
269
	    info->cmd = *flags;
270
	    break;																											
270
	    break;																											
271
	case 'h':		/*cmd: waste*/
271
	case 'h':		/*cmd: waste*/
272
            if ((*flags & IPP2P_WASTE) == IPP2P_WASTE)
272
            if ((*flags & IPP2P_WASTE) == IPP2P_WASTE)
273
            exit_error(PARAMETER_PROBLEM,
273
            xtables_error(PARAMETER_PROBLEM,
274
                                "ipp2p: `--waste' may only be "
274
                                "ipp2p: `--waste' may only be "
275
                                "specified once!");
275
                                "specified once!");
276
	    if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
276
	    if (invert) xtables_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
277
            *flags += IPP2P_WASTE;
277
            *flags += IPP2P_WASTE;
278
	    info->cmd = *flags;
278
	    info->cmd = *flags;
279
	    break;																											
279
	    break;																											
280
	case 'i':		/*cmd: xdcc*/
280
	case 'i':		/*cmd: xdcc*/
281
            if ((*flags & IPP2P_XDCC) == IPP2P_XDCC)
281
            if ((*flags & IPP2P_XDCC) == IPP2P_XDCC)
282
            exit_error(PARAMETER_PROBLEM,
282
            xtables_error(PARAMETER_PROBLEM,
283
                                "ipp2p: `--ares' may only be "
283
                                "ipp2p: `--ares' may only be "
284
                                "specified once!");
284
                                "specified once!");
285
	    if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
285
	    if (invert) xtables_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
286
            *flags += IPP2P_XDCC;
286
            *flags += IPP2P_XDCC;
287
	    info->cmd = *flags;
287
	    info->cmd = *flags;
288
	    break;																											
288
	    break;																											
289
289
290
	case 'j':		/*cmd: debug*/
290
	case 'j':		/*cmd: debug*/
291
	    if (invert) exit_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
291
	    if (invert) xtables_error(PARAMETER_PROBLEM, "ipp2p: invert [!] is not allowed!");
292
	    info->debug = 1;
292
	    info->debug = 1;
293
	    break;																											
293
	    break;																											
294
294
295
	default:
295
	default:
296
//            exit_error(PARAMETER_PROBLEM,
296
//            xtables_error(PARAMETER_PROBLEM,
297
//	    "\nipp2p-parameter problem: for ipp2p usage type: iptables -m ipp2p --help\n");
297
//	    "\nipp2p-parameter problem: for ipp2p usage type: iptables -m ipp2p --help\n");
298
	    return 0;
298
	    return 0;
299
    }
299
    }
Lines 305-311 Link Here
305
final_check(unsigned int flags)
305
final_check(unsigned int flags)
306
{
306
{
307
    if (!flags)
307
    if (!flags)
308
            exit_error(PARAMETER_PROBLEM,
308
            xtables_error(PARAMETER_PROBLEM,
309
	    "\nipp2p-parameter problem: for ipp2p usage type: iptables -m ipp2p --help\n");
309
	    "\nipp2p-parameter problem: for ipp2p usage type: iptables -m ipp2p --help\n");
310
}
310
}
311
311
Lines 378-384 Link Here
378
    .next           = NULL,
378
    .next           = NULL,
379
    .name           = "ipp2p",
379
    .name           = "ipp2p",
380
    .family         = PF_INET,
380
    .family         = PF_INET,
381
    .version        = IPTABLES_VERSION,
381
    .version        = XTABLES_VERSION,
382
    .size           = XT_ALIGN(sizeof(struct ipt_p2p_info)),
382
    .size           = XT_ALIGN(sizeof(struct ipt_p2p_info)),
383
    .userspacesize  = XT_ALIGN(sizeof(struct ipt_p2p_info)),
383
    .userspacesize  = XT_ALIGN(sizeof(struct ipt_p2p_info)),
384
    .help           = &help,
384
    .help           = &help,

Return to bug 265460