diff options
| -rw-r--r-- | daemon/device.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/daemon/device.c b/daemon/device.c index 759cb91..824edac 100644 --- a/daemon/device.c +++ b/daemon/device.c | |||
| @@ -461,12 +461,18 @@ static void device_version_input(struct mux_device *dev, struct version_header * | |||
| 461 | 461 | ||
| 462 | static void device_tcp_input(struct mux_device *dev, struct tcphdr *th, unsigned char *payload, uint32_t payload_length) | 462 | static void device_tcp_input(struct mux_device *dev, struct tcphdr *th, unsigned char *payload, uint32_t payload_length) |
| 463 | { | 463 | { |
| 464 | usbmuxd_log(LL_DEBUG, "[IN] dev=%d sport=%d dport=%d seq=%d ack=%d flags=0x%x window=%d[%d] len=%d", | ||
| 465 | dev->id, ntohs(th->th_sport), ntohs(th->th_dport), ntohl(th->th_seq), ntohl(th->th_ack), th->th_flags, ntohs(th->th_win) << 8, ntohs(th->th_win), payload_length); | ||
| 466 | |||
| 467 | uint16_t sport = ntohs(th->th_dport); | 464 | uint16_t sport = ntohs(th->th_dport); |
| 468 | uint16_t dport = ntohs(th->th_sport); | 465 | uint16_t dport = ntohs(th->th_sport); |
| 469 | struct mux_connection *conn = NULL; | 466 | struct mux_connection *conn = NULL; |
| 467 | |||
| 468 | usbmuxd_log(LL_DEBUG, "[IN] dev=%d sport=%d dport=%d seq=%d ack=%d flags=0x%x window=%d[%d] len=%d", | ||
| 469 | dev->id, dport, sport, ntohl(th->th_seq), ntohl(th->th_ack), th->th_flags, ntohs(th->th_win) << 8, ntohs(th->th_win), payload_length); | ||
| 470 | |||
| 471 | if(dev->state != MUXDEV_ACTIVE) { | ||
| 472 | usbmuxd_log(LL_ERROR, "Received TCP packet from device %d but the device isn't active yet, discarding\n", dev->id); | ||
| 473 | return; | ||
| 474 | } | ||
| 475 | |||
| 470 | FOREACH(struct mux_connection *lconn, &dev->connections) { | 476 | FOREACH(struct mux_connection *lconn, &dev->connections) { |
| 471 | if(lconn->sport == sport && lconn->dport == dport) { | 477 | if(lconn->sport == sport && lconn->dport == dport) { |
| 472 | conn = lconn; | 478 | conn = lconn; |
