summaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/ip/ip4_source_and_port_range_check.c5
-rw-r--r--vnet/vnet/ipsec/ikev2_cli.c15
-rw-r--r--vnet/vnet/ipsec/ipsec.c36
-rw-r--r--vnet/vnet/ipsec/ipsec.h6
-rw-r--r--vnet/vnet/ipsec/ipsec_output.c26
-rw-r--r--vnet/vnet/map/ip4_map.c24
-rw-r--r--vnet/vnet/map/ip4_map_t.c4
-rw-r--r--vnet/vnet/map/ip6_map.c17
-rw-r--r--vnet/vnet/map/map.c11
-rw-r--r--vnet/vnet/sr/sr_replicate.c4
10 files changed, 68 insertions, 80 deletions
diff --git a/vnet/vnet/ip/ip4_source_and_port_range_check.c b/vnet/vnet/ip/ip4_source_and_port_range_check.c
index f716ebdb1e1..00faddf0fb3 100644
--- a/vnet/vnet/ip/ip4_source_and_port_range_check.c
+++ b/vnet/vnet/ip/ip4_source_and_port_range_check.c
@@ -240,10 +240,9 @@ always_inline uword
ASSERT (adj_index0 == ip4_fib_lookup_with_table (im, fib_index0,
&ip0->
- src_address,
- 0
+ src_address, 0
/* use dflt rt */
- ));
+ ));
adj0 = ip_get_adjacency (lm, adj_index0);
}
diff --git a/vnet/vnet/ipsec/ikev2_cli.c b/vnet/vnet/ipsec/ikev2_cli.c
index beba8352c8c..bbd9a5739bc 100644
--- a/vnet/vnet/ipsec/ikev2_cli.c
+++ b/vnet/vnet/ipsec/ikev2_cli.c
@@ -263,9 +263,8 @@ ikev2_profile_add_del_command_fn (vlib_main_t * vm,
{
data = vec_new (u8, 4);
clib_memcpy (data, ip4.as_u8, 4);
- r =
- ikev2_set_profile_id (vm, name, (u8) id_type, data, /*remote */
- 0);
+ r = ikev2_set_profile_id (vm, name, (u8) id_type, data, /*remote */
+ 0);
goto done;
}
else if (unformat (line_input, "set %U id remote %U 0x%U",
@@ -273,18 +272,16 @@ ikev2_profile_add_del_command_fn (vlib_main_t * vm,
unformat_ikev2_id_type, &id_type,
unformat_hex_string, &data))
{
- r =
- ikev2_set_profile_id (vm, name, (u8) id_type, data, /*remote */
- 0);
+ r = ikev2_set_profile_id (vm, name, (u8) id_type, data, /*remote */
+ 0);
goto done;
}
else if (unformat (line_input, "set %U id remote %U %v",
unformat_token, valid_chars, &name,
unformat_ikev2_id_type, &id_type, &data))
{
- r =
- ikev2_set_profile_id (vm, name, (u8) id_type, data, /*remote */
- 0);
+ r = ikev2_set_profile_id (vm, name, (u8) id_type, data, /*remote */
+ 0);
goto done;
}
else if (unformat (line_input, "set %U traffic-selector local "
diff --git a/vnet/vnet/ipsec/ipsec.c b/vnet/vnet/ipsec/ipsec.c
index b3075bf7598..42b8f29dc44 100644
--- a/vnet/vnet/ipsec/ipsec.c
+++ b/vnet/vnet/ipsec/ipsec.c
@@ -220,19 +220,19 @@ ipsec_add_del_policy (vlib_main_t * vm, ipsec_policy_t * policy, int is_add)
vec_add1 (spd->ipv6_inbound_protect_policy_indices,
policy_index);
clib_memcpy (vp, policy, sizeof (ipsec_policy_t));
- vec_sort_with_function (spd->
- ipv6_inbound_protect_policy_indices,
- ipsec_spd_entry_sort);
+ vec_sort_with_function
+ (spd->ipv6_inbound_protect_policy_indices,
+ ipsec_spd_entry_sort);
}
else
{
- vec_add1 (spd->
- ipv6_inbound_policy_discard_and_bypass_indices,
- policy_index);
+ vec_add1
+ (spd->ipv6_inbound_policy_discard_and_bypass_indices,
+ policy_index);
clib_memcpy (vp, policy, sizeof (ipsec_policy_t));
- vec_sort_with_function (spd->
- ipv6_inbound_policy_discard_and_bypass_indices,
- ipsec_spd_entry_sort);
+ vec_sort_with_function
+ (spd->ipv6_inbound_policy_discard_and_bypass_indices,
+ ipsec_spd_entry_sort);
}
}
else
@@ -242,19 +242,19 @@ ipsec_add_del_policy (vlib_main_t * vm, ipsec_policy_t * policy, int is_add)
vec_add1 (spd->ipv4_inbound_protect_policy_indices,
policy_index);
clib_memcpy (vp, policy, sizeof (ipsec_policy_t));
- vec_sort_with_function (spd->
- ipv4_inbound_protect_policy_indices,
- ipsec_spd_entry_sort);
+ vec_sort_with_function
+ (spd->ipv4_inbound_protect_policy_indices,
+ ipsec_spd_entry_sort);
}
else
{
- vec_add1 (spd->
- ipv4_inbound_policy_discard_and_bypass_indices,
- policy_index);
+ vec_add1
+ (spd->ipv4_inbound_policy_discard_and_bypass_indices,
+ policy_index);
clib_memcpy (vp, policy, sizeof (ipsec_policy_t));
- vec_sort_with_function (spd->
- ipv4_inbound_policy_discard_and_bypass_indices,
- ipsec_spd_entry_sort);
+ vec_sort_with_function
+ (spd->ipv4_inbound_policy_discard_and_bypass_indices,
+ ipsec_spd_entry_sort);
}
}
}
diff --git a/vnet/vnet/ipsec/ipsec.h b/vnet/vnet/ipsec/ipsec.h
index 5c43bf51ce7..5b88c8278fb 100644
--- a/vnet/vnet/ipsec/ipsec.h
+++ b/vnet/vnet/ipsec/ipsec.h
@@ -283,9 +283,9 @@ ipsec_alloc_empty_buffers (vlib_main_t * vm, ipsec_main_t * im)
}
n_alloc = vlib_buffer_alloc_from_free_list (vm,
- im->
- empty_buffers[cpu_index] +
- l, 2 * VLIB_FRAME_SIZE - l,
+ im->empty_buffers[cpu_index]
+ + l,
+ 2 * VLIB_FRAME_SIZE - l,
free_list_index);
_vec_len (im->empty_buffers[cpu_index]) = l + n_alloc;
diff --git a/vnet/vnet/ipsec/ipsec_output.c b/vnet/vnet/ipsec/ipsec_output.c
index 278dddc360e..e72890d1239 100644
--- a/vnet/vnet/ipsec/ipsec_output.c
+++ b/vnet/vnet/ipsec/ipsec_output.c
@@ -271,10 +271,10 @@ ipsec_output_node_fn (vlib_main_t * vm,
p0 = ipsec_output_ip6_policy_match (spd0,
&ip6_0->src_address,
&ip6_0->dst_address,
- clib_net_to_host_u16 (udp0->
- src_port),
- clib_net_to_host_u16 (udp0->
- dst_port),
+ clib_net_to_host_u16
+ (udp0->src_port),
+ clib_net_to_host_u16
+ (udp0->dst_port),
ip6_0->protocol);
}
else
@@ -291,16 +291,14 @@ ipsec_output_node_fn (vlib_main_t * vm,
#endif
p0 = ipsec_output_policy_match (spd0, ip0->protocol,
- clib_net_to_host_u32 (ip0->
- src_address.
- as_u32),
- clib_net_to_host_u32 (ip0->
- dst_address.
- as_u32),
- clib_net_to_host_u16 (udp0->
- src_port),
- clib_net_to_host_u16 (udp0->
- dst_port));
+ clib_net_to_host_u32
+ (ip0->src_address.as_u32),
+ clib_net_to_host_u32
+ (ip0->dst_address.as_u32),
+ clib_net_to_host_u16
+ (udp0->src_port),
+ clib_net_to_host_u16
+ (udp0->dst_port));
}
if (PREDICT_TRUE (p0 != NULL))
diff --git a/vnet/vnet/map/ip4_map.c b/vnet/vnet/map/ip4_map.c
index 1a75ca3a68b..b2795acec2b 100644
--- a/vnet/vnet/map/ip4_map.c
+++ b/vnet/vnet/map/ip4_map.c
@@ -320,12 +320,10 @@ ip4_map (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
ip4_map_decrement_ttl (ip40, &error0);
ip4_map_decrement_ttl (ip41, &error1);
bool df0 =
- ip40->
- flags_and_fragment_offset &
+ ip40->flags_and_fragment_offset &
clib_host_to_net_u16 (IP4_HEADER_FLAG_DONT_FRAGMENT);
bool df1 =
- ip41->
- flags_and_fragment_offset &
+ ip41->flags_and_fragment_offset &
clib_host_to_net_u16 (IP4_HEADER_FLAG_DONT_FRAGMENT);
/* MAP calc */
@@ -487,8 +485,7 @@ ip4_map (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
/* Decrement IPv4 TTL */
ip4_map_decrement_ttl (ip40, &error0);
bool df0 =
- ip40->
- flags_and_fragment_offset &
+ ip40->flags_and_fragment_offset &
clib_host_to_net_u16 (IP4_HEADER_FLAG_DONT_FRAGMENT);
/* MAP calc */
@@ -613,11 +610,11 @@ ip4_map_reass (vlib_main_t * vm,
&map_domain_index0);
map_ip4_reass_lock ();
- map_ip4_reass_t *r =
- map_ip4_reass_get (ip40->src_address.as_u32,
- ip40->dst_address.as_u32,
- ip40->fragment_id, ip40->protocol,
- &fragments_to_drop);
+ map_ip4_reass_t *r = map_ip4_reass_get (ip40->src_address.as_u32,
+ ip40->dst_address.as_u32,
+ ip40->fragment_id,
+ ip40->protocol,
+ &fragments_to_drop);
if (PREDICT_FALSE (!r))
{
// Could not create a caching entry
@@ -711,9 +708,8 @@ ip4_map_reass (vlib_main_t * vm,
vlib_increment_combined_counter (cm + MAP_DOMAIN_COUNTER_TX,
cpu_index, map_domain_index0,
1,
- clib_net_to_host_u16 (ip60->
- payload_length)
- + 40);
+ clib_net_to_host_u16
+ (ip60->payload_length) + 40);
next0 =
(error0 == MAP_ERROR_NONE) ? next0 : IP4_MAP_REASS_NEXT_DROP;
p0->error = error_node->errors[error0];
diff --git a/vnet/vnet/map/ip4_map_t.c b/vnet/vnet/map/ip4_map_t.c
index 6c3a80cc5f3..15974d8a46e 100644
--- a/vnet/vnet/map/ip4_map_t.c
+++ b/vnet/vnet/map/ip4_map_t.c
@@ -376,8 +376,8 @@ _ip4_map_t_icmp (map_domain_t * d, vlib_buffer_t * p, u8 * error)
}
else
{
- /* To shut up Coverity */
- os_panic();
+ /* To shut up Coverity */
+ os_panic ();
}
//FIXME: Security check with the port found in the inner packet
diff --git a/vnet/vnet/map/ip6_map.c b/vnet/vnet/map/ip6_map.c
index b51e8358d41..44f0e5dd677 100644
--- a/vnet/vnet/map/ip6_map.c
+++ b/vnet/vnet/map/ip6_map.c
@@ -870,11 +870,11 @@ ip6_map_ip4_reass (vlib_main_t * vm,
map_ip4_reass_lock ();
//This node only deals with fragmented ip4
- map_ip4_reass_t *r =
- map_ip4_reass_get (ip40->src_address.as_u32,
- ip40->dst_address.as_u32,
- ip40->fragment_id, ip40->protocol,
- &fragments_to_drop);
+ map_ip4_reass_t *r = map_ip4_reass_get (ip40->src_address.as_u32,
+ ip40->dst_address.as_u32,
+ ip40->fragment_id,
+ ip40->protocol,
+ &fragments_to_drop);
if (PREDICT_FALSE (!r))
{
// Could not create a caching entry
@@ -968,8 +968,8 @@ ip6_map_ip4_reass (vlib_main_t * vm,
vlib_increment_combined_counter (cm + MAP_DOMAIN_COUNTER_RX,
cpu_index, map_domain_index0,
1,
- clib_net_to_host_u16 (ip40->
- length));
+ clib_net_to_host_u16
+ (ip40->length));
next0 =
(error0 ==
MAP_ERROR_NONE) ? next0 : IP6_MAP_IP4_REASS_NEXT_DROP;
@@ -1113,8 +1113,7 @@ ip6_map_icmp_relay (vlib_main_t * vm,
/* Check DF flag */
if (!
- (inner_ip40->
- flags_and_fragment_offset &
+ (inner_ip40->flags_and_fragment_offset &
clib_host_to_net_u16 (IP4_HEADER_FLAG_DONT_FRAGMENT)))
{
error0 = MAP_ERROR_ICMP_RELAY;
diff --git a/vnet/vnet/map/map.c b/vnet/vnet/map/map.c
index 93a10c679f0..fdd56ee488d 100644
--- a/vnet/vnet/map/map.c
+++ b/vnet/vnet/map/map.c
@@ -128,8 +128,9 @@ ip6_get_port (ip6_header_t * ip6, map_dir_e dir, u16 buffer_len)
if (l4_protocol == IP_PROTOCOL_TCP || l4_protocol == IP_PROTOCOL_UDP)
{
return (dir ==
- MAP_SENDER) ? ((udp_header_t *) (l4))->
- src_port : ((udp_header_t *) (l4))->dst_port;
+ MAP_SENDER) ? ((udp_header_t *) (l4))->src_port : ((udp_header_t
+ *)
+ (l4))->dst_port;
}
else if (l4_protocol == IP_PROTOCOL_ICMP6)
{
@@ -230,8 +231,7 @@ map_create_domain (ip4_address_t * ip4_prefix,
memset (&adj, 0, sizeof (adj));
adj.explicit_fib_index = ~0;
adj.lookup_next_index =
- (d->
- flags & MAP_DOMAIN_TRANSLATION) ? IP_LOOKUP_NEXT_MAP_T :
+ (d->flags & MAP_DOMAIN_TRANSLATION) ? IP_LOOKUP_NEXT_MAP_T :
IP_LOOKUP_NEXT_MAP;
p = (uword *) & adj.rewrite_data[0];
*p = (uword) (*map_domain_index);
@@ -339,8 +339,7 @@ map_delete_domain (u32 map_domain_index)
memset (&adj, 0, sizeof (adj));
adj.explicit_fib_index = ~0;
adj.lookup_next_index =
- (d->
- flags & MAP_DOMAIN_TRANSLATION) ? IP_LOOKUP_NEXT_MAP_T :
+ (d->flags & MAP_DOMAIN_TRANSLATION) ? IP_LOOKUP_NEXT_MAP_T :
IP_LOOKUP_NEXT_MAP;
/* Delete ip4 adjacency */
diff --git a/vnet/vnet/sr/sr_replicate.c b/vnet/vnet/sr/sr_replicate.c
index 8a51fdb882d..4711ff1a1ed 100644
--- a/vnet/vnet/sr/sr_replicate.c
+++ b/vnet/vnet/sr/sr_replicate.c
@@ -357,8 +357,8 @@ sr_replicate_node_fn (vlib_main_t * vm,
(hdr_ip0->payload_length);
}
tr->next_index = next_index;
- if (hdr_sr0)
- memcpy (tr->sr, hdr_sr0, sizeof (tr->sr));
+ if (hdr_sr0)
+ memcpy (tr->sr, hdr_sr0, sizeof (tr->sr));
}
}