Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions curses.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ int mtr_curses_keyaction(void)
switch ( mtrtype ) {
case IPPROTO_ICMP:
case IPPROTO_TCP:
case IPPROTO_SCTP:
mtrtype = IPPROTO_UDP;
break;
case IPPROTO_UDP:
Expand All @@ -276,12 +277,25 @@ int mtr_curses_keyaction(void)
switch ( mtrtype ) {
case IPPROTO_ICMP:
case IPPROTO_UDP:
case IPPROTO_SCTP:
mtrtype = IPPROTO_TCP;
break;
case IPPROTO_TCP:
mtrtype = IPPROTO_ICMP;
break;
}
}
if (tolower(c) == 's') {
switch ( mtrtype ) {
case IPPROTO_ICMP:
case IPPROTO_UDP:
case IPPROTO_TCP:
mtrtype = IPPROTO_SCTP;
break;
case IPPROTO_SCTP:
mtrtype = IPPROTO_ICMP;
break;
}
return ActionNone;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new feature: here's a new switch key s for SCTP

@LionNatsu LionNatsu Aug 3, 2016

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, it will surely not work. s conflicted with line 135, the key to Change Packet Size.

}
/* reserve to display help message -Min */
Expand Down
2 changes: 1 addition & 1 deletion net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1712,7 +1712,7 @@ void net_process_fds(fd_set *writefd)
for (at = 0; at < MaxSequence; at++) {
fd = sequence[at].socket;
if (fd > 0 && FD_ISSET(fd, writefd)) {
r = write(fd, "G", 1);
r = send(fd, "G", 1, MSG_NOSIGNAL);
/* if write was successful, or connection refused we have
* (probably) reached the remote address. Anything else happens to the
* connection, we write it off to avoid leaking sockets */
Expand Down
4 changes: 2 additions & 2 deletions select.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void select_loop(void) {
FD_SET(netfd, &readfd);
if(netfd >= maxfd) maxfd = netfd + 1;

if (mtrtype == IPPROTO_TCP)
if (mtrtype == IPPROTO_TCP || mtrtype == IPPROTO_SCTP)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the event handler(s) for socket? (I am not good at operating file descriptor)

net_add_fds(&writefd, &maxfd);

do {
Expand Down Expand Up @@ -266,7 +266,7 @@ void select_loop(void) {
}

/* Check for activity on open sockets */
if (mtrtype == IPPROTO_TCP)
if (mtrtype == IPPROTO_TCP || mtrtype == IPPROTO_SCTP)
net_process_fds(&writefd);
}
return;
Expand Down