- vlib_buffer_pull (b, sizeof (*mrep_hdr));
-
- for (i = 0; i < MREP_REC_COUNT (mrep_hdr); i++)
- {
- h = vlib_buffer_get_current (b);
- ttl = clib_net_to_host_u32 (MAP_REC_TTL (h));
- action = MAP_REC_ACTION (h);
- authoritative = MAP_REC_AUTH (h);
-
- len = lisp_msg_parse_mapping_record (b, &deid, &locators, &probed);
- if (len == ~0)
- {
- clib_warning ("Failed to parse mapping record!");
- vec_foreach (loc, locators)
- {
- locator_free (loc);
- }
- vec_free (locators);
- goto done;
- }
-
- /* insert/update mappings cache */
- vnet_lisp_add_del_mapping (&deid, locators, action, authoritative, ttl,
- 1, 0 /* is_static */ , &dst_map_index);
-
- /* try to program forwarding only if mapping saved or updated */
- if ((u32) ~ 0 != dst_map_index)
- {
- lisp_add_del_adjacency (lcm, &pmr->src, &deid, 1);
- if ((u32) ~ 0 != ttl)
- mapping_start_expiration_timer (lcm, dst_map_index, ttl * 60);
- }
+ vec_foreach (m, a->mappings)
+ {
+ /* insert/update mappings cache */
+ vnet_lisp_add_del_mapping (&m->eid, m->locators, m->action,
+ m->authoritative, m->ttl,
+ 1, 0 /* is_static */ , &dst_map_index);