aboutsummaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/open.c')
0 files changed, 0 insertions, 0 deletions
cgit.cgi/litmus-rt-ext-res.git/commit/net/netfilter/nf_nat_core.c?id=c7232c9979cba684c50b64c513c4a83c9aa70563'>c7232c9979cb
5b1158e909ec
8073e960a03b
e1bf1687740c
c7232c9979cb



ce4b1cebdcd4
a76ae1c85576
e1bf1687740c


c7232c9979cb


5b1158e909ec
c7232c9979cb
5b1158e909ec

c7232c9979cb




















5389023421b8
c7232c9979cb

5389023421b8
c7232c9979cb







c7232c9979cb

c7af6483b9f7
c7232c9979cb



aaa795ad25e1
c7232c9979cb
aaa795ad25e1
e7e6f6300faa
aaa795ad25e1
c7232c9979cb





c7af6483b9f7
c7232c9979cb
aaa795ad25e1
c7232c9979cb







aaa795ad25e1
c7232c9979cb




e1bf1687740c


5b1158e909ec
e1bf1687740c


7001c6d109ea
5b1158e909ec
e1bf1687740c

8fc54f689192
e1bf1687740c
5b1158e909ec

5b1158e909ec





c7232c9979cb




5b1158e909ec







c7232c9979cb





5b1158e909ec
5b1158e909ec
c7232c9979cb




5b1158e909ec
cbc9f2f4fcd7
c7232c9979cb


5b1158e909ec
c7232c9979cb
5b1158e909ec









c7232c9979cb
5b1158e909ec




308ac9143ee2

c7232c9979cb

0c4c9288ada0
5b1158e909ec
c7232c9979cb
5b1158e909ec
e1bf1687740c
72b72949db9a
870190a9ec90
e1bf1687740c











97772bcd56ef
97772bcd56ef
5b1158e909ec


c7232c9979cb




5b1158e909ec
308ac9143ee2

c7232c9979cb
5b1158e909ec


c7232c9979cb

5b1158e909ec
c7232c9979cb

5b1158e909ec

cbc9f2f4fcd7
5b1158e909ec

cbc9f2f4fcd7
c7232c9979cb
5b1158e909ec
c7232c9979cb
5b1158e909ec

c7232c9979cb

5b1158e909ec


c7232c9979cb




5b1158e909ec




c7232c9979cb

5693d68df688
c7232c9979cb
308ac9143ee2
c7232c9979cb















8fc54f689192
c7232c9979cb





5b1158e909ec

c7232c9979cb

6e23ae2a4875
c7232c9979cb
5b1158e909ec




c7232c9979cb
5b1158e909ec


308ac9143ee2
c7232c9979cb

0c4c9288ada0
308ac9143ee2

5b1158e909ec
c7232c9979cb



5b1158e909ec
c7232c9979cb







cbc9f2f4fcd7
34ce324019e7
41a7cab6d329
c7232c9979cb
41a7cab6d329

c7232c9979cb
41a7cab6d329
c7232c9979cb

0d53778e81ac
0dbff689c2f2
c7232c9979cb
5b1158e909ec


c7232c9979cb
5b1158e909ec
5d0aa2ccd469
5b1158e909ec

c7232c9979cb

5b1158e909ec

34ce324019e7
cbc9f2f4fcd7
c7232c9979cb



99ad3c53b36a





5b1158e909ec

c7232c9979cb
e22a05486913

5b1158e909ec

f768e5bdefe1












5b1158e909ec

c7232c9979cb
cc01dcbd2686
5b1158e909ec
e1bf1687740c
5b1158e909ec
2d59e5ca8c71
d110a3942aca



44d6e2f27328

75c2631468e8


5b1158e909ec

c7232c9979cb



5b1158e909ec












cbc9f2f4fcd7
5b1158e909ec


41d73ec053d2
ab6dd1beac7b
4440a2ab3b9f

5b1158e909ec

cbc9f2f4fcd7
e1bf1687740c
8073e960a03b
e1bf1687740c


b0ade85165b3
8073e960a03b
e1bf1687740c

8073e960a03b
5b1158e909ec


cbc9f2f4fcd7
a7c2f4d7daf9
5b1158e909ec
a7c2f4d7daf9
5b1158e909ec




0eba801b64cc

f59cb0453cd8





0eba801b64cc
f59cb0453cd8






0eba801b64cc






f59cb0453cd8


5b1158e909ec



3db05fea51cd
5b1158e909ec
c7232c9979cb

5b1158e909ec



cbc9f2f4fcd7
5b1158e909ec














c7232c9979cb



5b1158e909ec





c7232c9979cb


c7232c9979cb

c2d421e17186

5b1158e909ec
c7232c9979cb
c2d421e17186
c7232c9979cb

5b1158e909ec

c2d421e17186
c7232c9979cb
5b1158e909ec
8073e960a03b




b0ade85165b3
8073e960a03b
b0ade85165b3
8073e960a03b

945b2b2d259d

945b2b2d259d


6e699867f84c
945b2b2d259d







124dffea9e8e
8073e960a03b
945b2b2d259d
945b2b2d259d





c7232c9979cb





c7232c9979cb
8f23f35f1e89
c7232c9979cb
5b1158e909ec
c7232c9979cb




c7232c9979cb
8f23f35f1e89
5b1158e909ec
5b1158e909ec

c7232c9979cb
5b1158e909ec
c7232c9979cb

5b1158e909ec

c7232c9979cb



















eb733162ae4f
c7232c9979cb


5b1158e909ec


c7232c9979cb
5b1158e909ec
c7232c9979cb
5b1158e909ec

c7232c9979cb
5b1158e909ec
25985edcedea
c7232c9979cb
5b1158e909ec
c7232c9979cb



e22a05486913
c7232c9979cb

5b1158e909ec
c7232c9979cb














0c4e966eafff



7a2dd28c7034



b8ad652f9779



c7232c9979cb

















5b1158e909ec
25985edcedea
d8a0509a696d

8073e960a03b

2d59e5ca8c71

61eb3107cd8e
d8a0509a696d


d8a0509a696d
2d59e5ca8c71

24de3d377539
e6a7d3c04f8f










c7232c9979cb
e6a7d3c04f8f

c7232c9979cb
e6a7d3c04f8f

fceb6435e852

e6a7d3c04f8f


c7232c9979cb



e6a7d3c04f8f



c7232c9979cb

58a317f1061c

329fb58a93b2
e6a7d3c04f8f


3993832464dd
0eba801b64cc

e6a7d3c04f8f





fceb6435e852
e6a7d3c04f8f


c7232c9979cb

0eba801b64cc
e6a7d3c04f8f

0eba801b64cc
e6a7d3c04f8f
0eba801b64cc
e6a7d3c04f8f

0eba801b64cc
e6a7d3c04f8f


3993832464dd
e6a7d3c04f8f
c7232c9979cb
0eba801b64cc
c7232c9979cb
e6a7d3c04f8f
0eba801b64cc














7025bac47fba
0eba801b64cc

c7232c9979cb

e6a7d3c04f8f
ecfcdfec7e0c
e6a7d3c04f8f




3993832464dd
e6a7d3c04f8f




544d5c7d9f4d




5b1158e909ec

8073e960a03b
2d59e5ca8c71
e1bf1687740c

b0ade85165b3

e1bf1687740c



a76ae1c85576
2d59e5ca8c71

e1bf1687740c
2d59e5ca8c71


5b1158e909ec
b0ade85165b3
8073e960a03b

c7232c9979cb
5b1158e909ec
e6a7d3c04f8f
a9b3cd7f323b
e6a7d3c04f8f
c7232c9979cb



5b1158e909ec


5b1158e909ec

8f23f35f1e89
c7232c9979cb

8f23f35f1e89

2d59e5ca8c71
544d5c7d9f4d
a9b3cd7f323b
c7232c9979cb


3b7dabf02947

c7232c9979cb

e1bf1687740c

5b1158e909ec





1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863

                                     
                                                             
                                             









                                                                       
                      
                     
                        
                            
 


                                            

                                         


                                              
                                              
                                               
                                             
                                   
 
                                                
 



                                                                            
                                                              
 


                                                        


                                    
 
                                                        

 




















                                                                          
                                 

                                                
                       







                                                             

 
                                                                                



                              
                
 
                                                    
                    
                           





                                                      
                                                     
                        
                                    







                                                                             
                               




                                 


                                                                        
 


                                                                   
 
                                                                     

                                                                               
 
                                                          

 





                                                                         




                                                                     







                                                                    





                                                           
 
                                                                




                                                                         
 
                                                             


                                                                    
 
                 









                                                         
                                                               




                                                  

                                                          

                                                          
                                                            
                                                       
                                                      
 
                                                 
                                 
 











                                                                              
         
                 


                                                              




                                                                     
           

                                                         
                                                     


                                                     

                                    
                        

                                  

                                         
                                                   

                       
                                          
                                         
            
                                         

                                         

                                                                   


                       




                                                             




                                                                      

                                           
                                                                              
                                                           
                                                                            















                                                                              
                                                                 





                                                               

 

                                                                       
                                                                   
                                                                     




                                                                     
                                                  


                                                  
                                             

                                             
                                        

                              
 



                                                                  
 







                                                                      
                                            
                                                              
                                                  
                                                                    

                                                                 
                                         
                         

                                                                            
                                                                              
                                                          
                                         


                 
                                                                              
                             
                                                               

                                                                    

                                            

                                                                         
                                                              
                                                                  



                                                                            





                                                            

                                                                      
                                                                    

                          

 












                                                                   

                                     
                                                   
                                                   
 
                                        
                                                        
 



                                                    

                                                


                                                       

                                                                   



                                                                  












                                                                        
                                                  


                                                  
 
                                                      

                                                     

         
                                            
                                     
                                 


                                                                                
                                                                
                                   

                                                              
                                     


                        
                                          
                                               
            
                                               




                                 

                                                                             





                                                                         
                                            






                                                             






                                                                    


                                             



                                                             
                                               
 

                                             



                                                           
                                      














                                                                            



                                                                         





                                       


                           

  

                                                             
 
                                                      
 

                                                                    

                         
                                                
 
 




                                                                                 
                                                         
                                         
                                                           

 

                                                             


                                          
                                                 







                                                                             
                                                     
                                       
 





                                                                         





                                                        
 
                                                           
 
 




                                            
 
                                                           
 

                            
                                                                             
 

                                               

                    



















                                                                                 
                                      


                                                                   


                             
                                                                              
     
                                          

                   
                                           
 
                                                            
                                                                                
 



                                                                    
                          

                                                        
 














                                                                        



                                                                         



                                                                         



                                                                            

















                                                                     
 
                                                     

                                                        

                                               

 
                                                         


                                                          
                                        

  
                                    










                                                                          
                                                                

                                              
                                             

                

                                                          


                           



                                                                             



                                                                

                                                      

                                                                     
                                                         


          
                                             

                                                                         





                                         
                                                                           


                           

                                                  
                           

                               
                         
 
                                                                       

 
                                                   


                                                       
                                                    
 
                                  
                                             
                
 














                                                                              
                                                                                       

                                                             

                           
 
                                                                             




                                                       
                                                    




                           




                                                         

                                   
                   
 

                                                      

                                                     



                                                                        
 

                                                 
                                                                          


                                                                               
 
                                             

                                                 
                                                           
 
                                                       
                                                        
                                                      



                                                                              


                 

                                       
                                             

                       

                                                          
                                             
                                                             
                                                               


                                                           

                          

                                              

                                                                  





                            
/*
 * (C) 1999-2001 Paul `Rusty' Russell
 * (C) 2002-2006 Netfilter Core Team <coreteam@netfilter.org>
 * (C) 2011 Patrick McHardy <kaber@trash.net>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#include <linux/module.h>
#include <linux/types.h>
#include <linux/timer.h>
#include <linux/skbuff.h>
#include <linux/gfp.h>
#include <net/xfrm.h>
#include <linux/jhash.h>
#include <linux/rtnetlink.h>

#include <net/netfilter/nf_conntrack.h>
#include <net/netfilter/nf_conntrack_core.h>
#include <net/netfilter/nf_nat.h>
#include <net/netfilter/nf_nat_l3proto.h>
#include <net/netfilter/nf_nat_l4proto.h>
#include <net/netfilter/nf_nat_core.h>
#include <net/netfilter/nf_nat_helper.h>
#include <net/netfilter/nf_conntrack_helper.h>
#include <net/netfilter/nf_conntrack_seqadj.h>
#include <net/netfilter/nf_conntrack_l3proto.h>
#include <net/netfilter/nf_conntrack_zones.h>
#include <linux/netfilter/nf_nat.h>

static spinlock_t nf_nat_locks[CONNTRACK_LOCKS];

static DEFINE_MUTEX(nf_nat_proto_mutex);
static const struct nf_nat_l3proto __rcu *nf_nat_l3protos[NFPROTO_NUMPROTO]
						__read_mostly;
static const struct nf_nat_l4proto __rcu **nf_nat_l4protos[NFPROTO_NUMPROTO]
						__read_mostly;

static struct hlist_head *nf_nat_bysource __read_mostly;
static unsigned int nf_nat_htable_size __read_mostly;
static unsigned int nf_nat_hash_rnd __read_mostly;

inline const struct nf_nat_l3proto *
__nf_nat_l3proto_find(u8 family)
{
	return rcu_dereference(nf_nat_l3protos[family]);
}

inline const struct nf_nat_l4proto *
__nf_nat_l4proto_find(u8 family, u8 protonum)
{
	return rcu_dereference(nf_nat_l4protos[family][protonum]);
}
EXPORT_SYMBOL_GPL(__nf_nat_l4proto_find);

#ifdef CONFIG_XFRM
static void __nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl)
{
	const struct nf_nat_l3proto *l3proto;
	const struct nf_conn *ct;
	enum ip_conntrack_info ctinfo;
	enum ip_conntrack_dir dir;
	unsigned  long statusbit;
	u8 family;

	ct = nf_ct_get(skb, &ctinfo);
	if (ct == NULL)
		return;

	family = nf_ct_l3num(ct);
	l3proto = __nf_nat_l3proto_find(family);
	if (l3proto == NULL)
		return;

	dir = CTINFO2DIR(ctinfo);
	if (dir == IP_CT_DIR_ORIGINAL)
		statusbit = IPS_DST_NAT;
	else
		statusbit = IPS_SRC_NAT;

	l3proto->decode_session(skb, ct, dir, statusbit, fl);
}

int nf_xfrm_me_harder(struct net *net, struct sk_buff *skb, unsigned int family)
{
	struct flowi fl;
	unsigned int hh_len;
	struct dst_entry *dst;
	int err;

	err = xfrm_decode_session(skb, &fl, family);
	if (err < 0)
		return err;

	dst = skb_dst(skb);
	if (dst->xfrm)
		dst = ((struct xfrm_dst *)dst)->route;
	dst_hold(dst);

	dst = xfrm_lookup(net, dst, &fl, skb->sk, 0);