summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/pppoe/pppoe.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/plugins/pppoe/pppoe.c b/src/plugins/pppoe/pppoe.c
index fac29c781fa..dfbe2e487c9 100644
--- a/src/plugins/pppoe/pppoe.c
+++ b/src/plugins/pppoe/pppoe.c
@@ -146,16 +146,23 @@ pppoe_build_rewrite (vnet_main_t * vnm,
* @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)
+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
@@ -170,12 +177,14 @@ pppoe_update_adj (vnet_main_t * vnm, u32 sw_if_index, adj_index_t ai)
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)
{
case IP_LOOKUP_NEXT_ARP:
case IP_LOOKUP_NEXT_GLEAN:
- adj_nbr_midchain_update_rewrite (ai, pppoe_fixup,
+ adj_nbr_midchain_update_rewrite (ai, pppoe_fixup, t,
ADJ_FLAG_NONE,
pppoe_build_rewrite (vnm,
sw_if_index,
@@ -187,7 +196,7 @@ pppoe_update_adj (vnet_main_t * vnm, u32 sw_if_index, adj_index_t ai)
* Construct a partial rewrite from the known ethernet mcast dest MAC
* There's no MAC fixup, so the last 2 parameters are 0
*/
- adj_mcast_midchain_update_rewrite (ai, pppoe_fixup,
+ adj_mcast_midchain_update_rewrite (ai, pppoe_fixup, t,
ADJ_FLAG_NONE,
pppoe_build_rewrite (vnm,
sw_if_index,
@@ -207,8 +216,6 @@ pppoe_update_adj (vnet_main_t * vnm, u32 sw_if_index, adj_index_t ai)
break;
}
- session_id = pem->session_index_by_sw_if_index[sw_if_index];
- t = pool_elt_at_index (pem->sessions, session_id);
interface_tx_dpo_add_or_lock (vnet_link_to_dpo_proto (adj->ia_link),
t->encap_if_index, &dpo);
d='n24' href='#n24'>24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166