xfrm: allow to avoid copying DSCP during encapsulation
By default, DSCP is copying during encapsulation. Copying the DSCP in IPsec tunneling may be a bit dangerous because packets with different DSCP may get reordered relative to each other in the network and then dropped by the remote IPsec GW if the reordering becomes too big compared to the replay window. It is possible to avoid this copy with netfilter rules, but it's very convenient to be able to configure it for each SA directly. This patch adds a toogle for this purpose. By default, it's not set to maintain backward compatibility. Field flags in struct xfrm_usersa_info is full, hence I add a new attribute. Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
This commit is contained in:
		
					parent
					
						
							
								6fac411572
							
						
					
				
			
			
				commit
				
					
						a947b0a93e
					
				
			
		
					 7 changed files with 30 additions and 4 deletions
				
			
		|  | @ -297,6 +297,7 @@ enum xfrm_attr_type_t { | |||
| 	XFRMA_MARK,		/* struct xfrm_mark */ | ||||
| 	XFRMA_TFCPAD,		/* __u32 */ | ||||
| 	XFRMA_REPLAY_ESN_VAL,	/* struct xfrm_replay_esn */ | ||||
| 	XFRMA_SA_EXTRA_FLAGS,	/* __u32 */ | ||||
| 	__XFRMA_MAX | ||||
| 
 | ||||
| #define XFRMA_MAX (__XFRMA_MAX - 1) | ||||
|  | @ -367,6 +368,8 @@ struct xfrm_usersa_info { | |||
| #define XFRM_STATE_ESN		128 | ||||
| }; | ||||
| 
 | ||||
| #define XFRM_SA_XFLAG_DONT_ENCAP_DSCP	1 | ||||
| 
 | ||||
| struct xfrm_usersa_id { | ||||
| 	xfrm_address_t			daddr; | ||||
| 	__be32				spi; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Nicolas Dichtel
				Nicolas Dichtel