(endpoint conn.Endpoint)
| 314 | } |
| 315 | |
| 316 | func (peer *Peer) SetEndpointFromPacket(endpoint conn.Endpoint) { |
| 317 | peer.endpoints.Lock() |
| 318 | defer peer.endpoints.Unlock() |
| 319 | if peer.endpoints.disableRoaming { |
| 320 | return |
| 321 | } |
| 322 | peer.endpoints.clearSrcOnTx = false |
| 323 | |
| 324 | if peer.endpoints.preferRoaming || len(peer.endpoints.val) == 0 { |
| 325 | if len(peer.endpoints.val) == 0 { |
| 326 | peer.endpoints.val = append(peer.endpoints.val, endpoint) |
| 327 | } else { |
| 328 | peer.endpoints.val[0] = endpoint |
| 329 | } |
| 330 | } |
| 331 | } |
| 332 | |
| 333 | // SetEndpoints configures the endpoints of the peer. The first endpoint will be the default endpoint used for packet routing |
| 334 | func (peer *Peer) SetEndpoints(endpoints []conn.Endpoint) { |
no outgoing calls
no test coverage detected