File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
examples/tcp_rerouting/src Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ impl StreamContext for TcpReroutingStream {
106106 // Use the Envoy-specific filter state mechanism
107107 // https://github.com/envoyproxy/envoy/issues/28128
108108 let status = self . call_foreign_function ( "set_envoy_filter_state" , Some ( & buf) ) ;
109-
109+
110110 info ! (
111111 "[TCP WASM] set_envoy_filter_state status (envoy.tcp_proxy.cluster): {:?}" ,
112112 status
@@ -129,10 +129,10 @@ impl StreamContext for TcpReroutingStream {
129129fn extract_last_octet ( addr : & str ) -> Option < u8 > {
130130 // Remove port if present (format: "ip:port")
131131 let ip_part = addr. split ( ':' ) . next ( ) ?;
132-
132+
133133 // Split by '.' and get the last segment
134- let last_segment = ip_part. split ( '.' ) . last ( ) ?;
135-
134+ let last_segment = ip_part. split ( '.' ) . next_back ( ) ?;
135+
136136 // Parse as u8
137137 last_segment. parse :: < u8 > ( ) . ok ( )
138138}
You can’t perform that action at this time.
0 commit comments