summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip6-nd
AgeCommit message (Collapse)AuthorFilesLines
2021-05-01vlib: refactor trajectory trace debug featureBenoît Ganne1-1/+0
trajectory trace has been broken for a while because we used to save the buffer trajectory in a vector pointed to in opaque2. This does not work well when opaque2 is copied (eg. because of a clone) as 2 buffers end up sharing the same vector. This dedicates a full cacheline in the buffer metadata instead when trajectory is compiled in. No dynamic allocation, no sharing, no tears. Type: refactor Change-Id: I6a028ca1b48d38f393a36979e5e452c2dd48ad3f Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-04-05ip6-nd: Solicitation reply only if target is our link-localNeale Ranns1-4/+9
Type: fix The fib source IP6_ND is used for all link-local entries, hence solicitation responses were sent for a peer's address. Constrain the source check to also in clude the LOCAL flag, which indicates that the link-local address is ours. Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: Iba7e66049e4d89ee3f36d77aeb09310b978d70de
2021-03-26vlib: introduce vlib_get_elog_main()Damjan Marion1-3/+4
Type: improvement Change-Id: I73383eb15186021cd6527d112da8443a0082f129 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-12-14misc: move to new pool_foreach macrosDamjan Marion4-54/+54
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-11-20ip-neighbor: Use ip_address_t rather than ip46_address_tNeale Ranns3-7/+20
Type: improvement Change-Id: Ica5f395075677bda5f38d28e704f65350af88610 Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-11-13ethernet: mac must support 64-bits loadsBenoît Ganne3-5/+5
ethernet dataplane loads MAC addresses as 64-bits loads for efficiency. We must make sure it is valid, especially for the vector of secondary MACs. Type: fix Change-Id: I851e319b8a973c154e85ff9f05f3b8e385939788 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-11-10ip6-nd: fix memory leaksDave Barach1-11/+23
Quite a noticeable amount of memory. Recoded ra event tx and rx fns in the usual manner, which terminated the leaks. Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I486d348456b465ad3940a280d4cf489e8dd655a5
2020-10-19ip: Move the IP6 fib into ip6_[m]fib.cNeale Ranns1-1/+2
Type: improvement reduce the compile time by moving the bihash includes out of ip[46].h Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: I6b9216e10aff1013071f9238b3e1ebbdd205bd80
2020-06-23ip6-nd: punt neighbor advertisementsAlexander Chernavin1-1/+1
With this change, punt received neighbor advertisements instead of drop in order to give other elements of the system an opportunity to handle them. Type: improvement Change-Id: Ie6cde9eebc83e42029967141cb32ebc459fd3680 Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2020-06-17ip-neighbor: fix MLD hash key using stack pointerBenoît Ganne1-2/+2
Use pointed value (ipv6 address) as hash key instead of pointer value (pointer to ipv6 address on the stack). Type: fix Change-Id: I74a8b6d4bb552b5b344bcb50c8e830700c4ce739 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-05-17ip6-nd: correct set-ip6-nd-proxy CLI short_helpIgnas Bacius1-1/+1
Type: fix Signed-off-by: Ignas Bacius <ignas@noia.network> Change-Id: Id99a15272f6f12a724a4cfd9de461f1aa6a6a634
2020-04-24ip: Setting the Link-Local address from the API enables IPv6 on theNeale Ranns1-2/+2
interface Type: fix Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: I0b7c189006e30a357cd6be4f3c9c61fded4157cb
2020-04-08misc: check return values from vlib_buffer_copy(...)Dave Barach1-0/+3
vlib_buffer_copy(...) returns NULL if the system is temporarily out of buffers. This is NOT correct. Please don't be this person: c0 = vlib_buffer_copy (vm, p0); ci0 = vlib_get_buffer_index (vm, c0); Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ic25ef58965871ea5d2b40904df9506803f69e47e
2020-02-26ip-neighbor: fix ip6_ra_cmdDave Barach1-10/+0
The option parsing loop had "break" statements included in each 'if (unformat (line_input, "this-option ...") option_values=xxx;' statement. Result: the code would silently ignore all but the first option. Probably broken forever, not easy to spot because the code looks OK even though it's badly broken. Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I667bee85b4ca654b53fb3af421f957957ed0f0f8
2020-02-21dhcp: update secondary radv_info structuresDave Barach2-5/+75
For details, see the Jira ticket below. Fix gerrit 23350. Type: fix Fixes: 28a6eb7 Ticket: VPP-1840 Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ic9248734bb330eadb302f8410e8db9c64723f075
2020-02-10ip-neighbor: fix MLD reports not being sentNeale Ranns1-3/+3
Type: fix Change-Id: I8f81cd6c29ff8cb4f0b4850b8b1f6611d89ddb38 Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-01-09misc: fix feature description spellingOle Troan1-3/+3
Type: docs Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I46856db81d42c3f10c03a7bf9a245cc998cd8a01
2020-01-05ip6-nd: Add FEATURE.yamlNeale Ranns1-0/+12
Type: docs Change-Id: I907f2c7f5d73dd88b16a6ff78ef072e13af9739e Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-12-17ip: Protocol Independent IP NeighborsNeale Ranns13-0/+5256
Type: feature - ip-neighbour: generic neighbour handling; APIs, DBs, event handling, aging - arp: ARP protocol implementation - ip6-nd; IPv6 neighbor discovery implementation; separate ND, MLD, RA - ip6-link; manage link-local addresses - l2-arp-term; events separated from IP neighbours, since they are not the same. vnet retains just enough education to perform ND/ARP packet construction. arp and ip6-nd to be moved to plugins soon. Change-Id: I88dedd0006b299344f4c7024a0aa5baa6b9a8bbe Signed-off-by: Neale Ranns <nranns@cisco.com>
="n">adj_index, format_ip_adjacency, t->adj_index, FORMAT_IP_ADJACENCY_NONE); return s; } typedef enum adj_nsh_rewrite_next_t_ { ADJ_NSH_REWRITE_NEXT_DROP, } adj_gpe_rewrite_next_t; always_inline uword adj_nsh_rewrite_inline (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame, int is_midchain) { u32 * from = vlib_frame_vector_args (frame); u32 n_left_from, n_left_to_next, * to_next, next_index; u32 thread_index = vlib_get_thread_index(); n_left_from = frame->n_vectors; next_index = node->cached_next_index; while (n_left_from > 0) { vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next); while (n_left_from > 0 && n_left_to_next > 0) { ip_adjacency_t * adj0; vlib_buffer_t * p0; char *h0; u32 pi0, rw_len0, adj_index0, next0 = 0; u32 tx_sw_if_index0; pi0 = to_next[0] = from[0]; from += 1; n_left_from -= 1; to_next += 1; n_left_to_next -= 1; p0 = vlib_get_buffer (vm, pi0); h0 = vlib_buffer_get_current (p0); adj_index0 = vnet_buffer (p0)->ip.adj_index[VLIB_TX]; /* We should never rewrite a pkt using the MISS adjacency */ ASSERT(adj_index0); adj0 = adj_get (adj_index0); /* Guess we are only writing on simple IP4 header. */ vnet_rewrite_one_header(adj0[0], h0, sizeof(ip4_header_t)); /* Update packet buffer attributes/set output interface. */ rw_len0 = adj0[0].rewrite_header.data_bytes; vnet_buffer(p0)->ip.save_rewrite_length = rw_len0; vlib_increment_combined_counter(&adjacency_counters, thread_index, adj_index0, /* packet increment */ 0, /* byte increment */ rw_len0); /* Check MTU of outgoing interface. */ if (PREDICT_TRUE((vlib_buffer_length_in_chain (vm, p0) <= adj0[0].rewrite_header.max_l3_packet_bytes))) { /* Don't adjust the buffer for ttl issue; icmp-error node wants * to see the IP header */ p0->current_data -= rw_len0; p0->current_length += rw_len0; tx_sw_if_index0 = adj0[0].rewrite_header.sw_if_index; if (is_midchain) { adj0->sub_type.midchain.fixup_func( vm, adj0, p0, adj0->sub_type.midchain.fixup_data); } vnet_buffer (p0)->sw_if_index[VLIB_TX] = tx_sw_if_index0; /* * Follow the feature ARC. this will result eventually in * the midchain-tx node */ vnet_feature_arc_start (nsh_main_placeholder.output_feature_arc_index, tx_sw_if_index0, &next0, p0); } else { /* can't fragment NSH */ next0 = ADJ_NSH_REWRITE_NEXT_DROP; } if (PREDICT_FALSE(p0->flags & VLIB_BUFFER_IS_TRACED)) { adj_nsh_trace_t *tr = vlib_add_trace (vm, node, p0, sizeof (*tr)); tr->adj_index = vnet_buffer(p0)->ip.adj_index[VLIB_TX]; } vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next, n_left_to_next, pi0, next0); } vlib_put_next_frame (vm, node, next_index, n_left_to_next); } return frame->n_vectors; } VLIB_NODE_FN (adj_nsh_rewrite_node) (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { return adj_nsh_rewrite_inline (vm, node, frame, 0); } VLIB_NODE_FN (adj_nsh_midchain_node) (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { return adj_nsh_rewrite_inline (vm, node, frame, 1); } VLIB_REGISTER_NODE (adj_nsh_rewrite_node) = { .name = "adj-nsh-rewrite", .vector_size = sizeof (u32), .format_trace = format_adj_nsh_trace, .n_next_nodes = 1, .next_nodes = { [ADJ_NSH_REWRITE_NEXT_DROP] = "error-drop", }, }; VLIB_REGISTER_NODE (adj_nsh_midchain_node) = { .name = "adj-nsh-midchain", .vector_size = sizeof (u32), .format_trace = format_adj_nsh_trace, .n_next_nodes = 1, .next_nodes = { [ADJ_NSH_REWRITE_NEXT_DROP] = "error-drop", }, }; /* Built-in ip4 tx feature path definition */ /* *INDENT-OFF* */ VNET_FEATURE_ARC_INIT (nsh_output, static) = { .arc_name = "nsh-output", .start_nodes = VNET_FEATURES ("adj-nsh-midchain"), .arc_index_ptr = &nsh_main_placeholder.output_feature_arc_index, }; VNET_FEATURE_INIT (nsh_tx_drop, static) = { .arc_name = "nsh-output", .node_name = "error-drop", .runs_before = 0, /* not before any other features */ }; /* *INDENT-ON* */