+
+ return rw;
+}
+
+/**
+ * @brief Fixup the adj rewrite post encap. Insert the packet's length
+ */
+static void
+pppoe_fixup (vlib_main_t * vm,
+ ip_adjacency_t * adj, vlib_buffer_t * b0, const void *data)
+{
+ const pppoe_session_t *t;
+ pppoe_header_t *pppoe0;
+
+ /* update the rewrite string */
+ pppoe0 = vlib_buffer_get_current (b0) + sizeof (ethernet_header_t);
+
+ pppoe0->length = clib_host_to_net_u16 (vlib_buffer_length_in_chain (vm, b0)
+ - sizeof (pppoe_header_t)
+ + sizeof (pppoe0->ppp_proto)
+ - sizeof (ethernet_header_t));
+ /* Swap to the the packet's output interface to the encap (not the
+ * session) interface */
+ t = data;
+ vnet_buffer (b0)->sw_if_index[VLIB_TX] = t->encap_if_index;
+}
+
+static void
+pppoe_update_adj (vnet_main_t * vnm, u32 sw_if_index, adj_index_t ai)
+{
+ pppoe_main_t *pem = &pppoe_main;
+ dpo_id_t dpo = DPO_INVALID;
+ ip_adjacency_t *adj;
+ pppoe_session_t *t;
+ u32 session_id;
+
+ ASSERT (ADJ_INDEX_INVALID != ai);
+
+ adj = adj_get (ai);
+ session_id = pem->session_index_by_sw_if_index[sw_if_index];
+ t = pool_elt_at_index (pem->sessions, session_id);
+
+ switch (adj->lookup_next_index)