Hi, i have tested netcat on arm linux platform and it seem to doesn't work on it. it exit without any error message and with no connection attempt. > netcat 127.0.0.1 6600 >
Logged In: NO
I see the same behavior on ppc-linux. Don't have time for a useful bug report yet.
netcat (The GNU Netcat) 0.7.1
# /root/netcat -d -v -v -v -v 127.0.0.1 2323 (debug) Trying to parse non-args parameters (argc=8, optind=6) (debug) netcat_resolvehost(dst=0x7fffefe8, name="127.0.0.1") (debug) netcat_inet_ntop(src=0x7fffec3c) (debug) netcat_getport(dst=0x7ffffc98, port_string="2323", port_num=0) (debug) netcat_getport(dst=0x7ffffc98, port_string="(null)", port_num=2323) (debug) Arguments parsing complete! Total ports=-1 (debug) Main: EXIT (cleaning up) Total received bytes: 0 Total sent bytes: 0 # echo $? 1
-Peter Jensen / diff.net
Had the same problem (on arm). The following line of the debug messages is interessting:
(debug) Arguments parsing complete! Total ports=-1
The result of netcat_flag_count() gets negativ. So the problem is in netcat_flag_count(). The following patch seemed to work for me:
--- netcat-0.7.1/src/flagset.c 2003-12-10 17:18:07.000000000 +0100
+++ ../netcat-0.7.1/src/flagset.c 2007-03-26 12:47:53.000000000 +0200
@@ -134,7 +134,7 @@
int netcat_flag_count(void)
{
- register char c;
+ register unsigned char c;
register int i;
int ret = 0;
@@ -154,8 +154,8 @@
Assumed that the bit number 1 is the sign, and that we will shift the
bit 1 (or the bit that takes its place later) until the the most right,
WHY it has to keep the wrong sign? */
- ret -= (c >> 7);
- c <<= 1;
+ ret += c&1;
+ c>>=1;
}
Logged In: YES user_id=1130656 Originator: NO
The following ARM patch works for me, too. Looks like someone wrote some very presumptious code :)
Log in to post a comment.
Logged In: NO
I see the same behavior on ppc-linux. Don't have time for a
useful bug report yet.
netcat (The GNU Netcat) 0.7.1
# /root/netcat -d -v -v -v -v 127.0.0.1 2323
(debug) Trying to parse non-args parameters (argc=8, optind=6)
(debug) netcat_resolvehost(dst=0x7fffefe8, name="127.0.0.1")
(debug) netcat_inet_ntop(src=0x7fffec3c)
(debug) netcat_getport(dst=0x7ffffc98, port_string="2323",
port_num=0)
(debug) netcat_getport(dst=0x7ffffc98, port_string="(null)",
port_num=2323)
(debug) Arguments parsing complete! Total ports=-1
(debug) Main: EXIT (cleaning up)
Total received bytes: 0
Total sent bytes: 0
# echo $?
1
-Peter Jensen / diff.net
Logged In: NO
Had the same problem (on arm). The following line of the debug messages is interessting:
(debug) Arguments parsing complete! Total ports=-1
The result of netcat_flag_count() gets negativ. So the problem is in netcat_flag_count(). The following patch seemed to work for me:
--- netcat-0.7.1/src/flagset.c 2003-12-10 17:18:07.000000000 +0100
+++ ../netcat-0.7.1/src/flagset.c 2007-03-26 12:47:53.000000000 +0200
@@ -134,7 +134,7 @@
int netcat_flag_count(void)
{
- register char c;
+ register unsigned char c;
register int i;
int ret = 0;
@@ -154,8 +154,8 @@
Assumed that the bit number 1 is the sign, and that we will shift the
bit 1 (or the bit that takes its place later) until the the most right,
WHY it has to keep the wrong sign? */
- ret -= (c >> 7);
- c <<= 1;
+ ret += c&1;
+ c>>=1;
}
}
Logged In: YES
user_id=1130656
Originator: NO
The following ARM patch works for me, too. Looks like someone wrote some very presumptious code :)