Changeset b9be9b0 in mainline
- Timestamp:
- 2022-03-04T09:11:58Z (3 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- af259da
- Parents:
- 917324b
- git-author:
- Jiri Svoboda <jiri@…> (2022-03-03 18:11:14)
- git-committer:
- Jiri Svoboda <jiri@…> (2022-03-04 09:11:58)
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/netecho/comm.c
r917324b rb9be9b0 52 52 static udp_t *udp; 53 53 static udp_assoc_t *assoc; 54 static inet_ep_t remote;55 54 56 55 #define RECV_BUF_SIZE 1024 … … 185 184 errno_t comm_send(void *data, size_t size) 186 185 { 187 errno_t rc = udp_assoc_send_msg(assoc, &remote, data, size);186 errno_t rc = udp_assoc_send_msg(assoc, NULL, data, size); 188 187 if (rc != EOK) 189 188 return EIO; -
uspace/lib/inet/src/udp.c
r917324b rb9be9b0 256 256 { 257 257 async_exch_t *exch; 258 inet_ep_t ddest; 258 259 259 260 exch = async_exchange_begin(assoc->udp->sess); 260 261 aid_t req = async_send_1(exch, UDP_ASSOC_SEND_MSG, assoc->id, NULL); 262 263 /* If dest is null, use default destination */ 264 if (dest == NULL) { 265 inet_ep_init(&ddest); 266 dest = &ddest; 267 } 261 268 262 269 errno_t rc = async_data_write_start(exch, (void *)dest, -
uspace/srv/net/udp/assoc.c
r917324b rb9be9b0 243 243 * 244 244 * @param assoc Association 245 * @param remote Remote endpoint or NULL not to override @a assoc 245 * @param remote Remote endpoint or inet_addr_any/inet_port_any 246 * not to override association's remote endpoint 246 247 * @param msg Message 247 248 * … … 261 262 /* @a remote can be used to override the remote endpoint */ 262 263 epp = assoc->ident; 263 if (remote != NULL) 264 if (!inet_addr_is_any(&remote->addr) && 265 remote->port != inet_port_any) 264 266 epp.remote = *remote; 265 267 -
uspace/srv/net/udp/test/assoc.c
r917324b rb9be9b0 250 250 } 251 251 252 /** Sending message with destination set in association and NULL destination253 * argument252 /** Sending message with destination set in association and inet_addr_any / 253 * inet_port_any destination argument 254 254 */ 255 PCUT_TEST(send_assoc_null_dest) 256 { 257 udp_assoc_t *assoc; 258 inet_ep2_t epp; 255 PCUT_TEST(send_assoc_any_dest) 256 { 257 udp_assoc_t *assoc; 258 inet_ep2_t epp; 259 inet_ep_t ep; 259 260 errno_t rc; 260 261 udp_msg_t *msg; … … 272 273 epp.local.port = 1; 273 274 275 inet_ep_init(&ep); 276 274 277 assoc = udp_assoc_new(&epp, &test_assoc_cb, NULL); 275 278 PCUT_ASSERT_NOT_NULL(assoc); … … 281 284 sent_msg = NULL; 282 285 283 rc = udp_assoc_send(assoc, NULL, msg);286 rc = udp_assoc_send(assoc, &ep, msg); 284 287 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 285 288 PCUT_ASSERT_EQUALS(msg, sent_msg); … … 311 314 312 315 inet_ep2_init(&epp); 313 inet_addr(&epp.remote.addr, 127, 0, 0, 1);314 epp.remote.port = 42;315 316 inet_addr(&epp.local.addr, 127, 0, 0, 1); 316 317 epp.local.port = 1;
Note:
See TracChangeset
for help on using the changeset viewer.