From: John Hodge Date: Fri, 29 Mar 2013 07:59:56 +0000 (+0800) Subject: Merge branch 'master' of git://localhost/acess2 X-Git-Tag: rel0.15~526 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=b732b8e8da2bea4916286333efb34a9a5e1bf01e;hp=055e0dd89c4c4b67d399d599c76674957e54b3e9;p=tpg%2Facess2.git Merge branch 'master' of git://localhost/acess2 --- diff --git a/KernelLand/Modules/Filesystems/InitRD/files.lst b/KernelLand/Modules/Filesystems/InitRD/files.lst index e369e4c1..d970a48f 100644 --- a/KernelLand/Modules/Filesystems/InitRD/files.lst +++ b/KernelLand/Modules/Filesystems/InitRD/files.lst @@ -2,6 +2,7 @@ Dir "SBin" { File "__BIN__/SBin/init" File "__BIN__/SBin/login" File "__BIN__/SBin/telnetd" + File "__BIN__/SBin/dhcpc" } Dir "Bin" { File "__BIN__/Bin/CLIShell" @@ -14,7 +15,6 @@ Dir "Bin" { File "__BIN__/Bin/telnet" File "__BIN__/Bin/irc" File "__BIN__/Bin/bomb" - File "__BIN__/SBin/dhcpc" } Dir "Libs" { File "__BIN__/Libs/ld-acess.so" diff --git a/KernelLand/Modules/IPStack/udp.c b/KernelLand/Modules/IPStack/udp.c index ae3806b4..eb8281b4 100644 --- a/KernelLand/Modules/IPStack/udp.c +++ b/KernelLand/Modules/IPStack/udp.c @@ -117,10 +117,8 @@ void UDP_GetPacket(tInterface *Interface, void *Address, int Length, void *Buffe { tUDPHeader *hdr = Buffer; - Log_Debug("UDP", "hdr->SourcePort = %i", ntohs(hdr->SourcePort)); - Log_Debug("UDP", "hdr->DestPort = %i", ntohs(hdr->DestPort)); - Log_Debug("UDP", "hdr->Length = %i", ntohs(hdr->Length)); - Log_Debug("UDP", "hdr->Checksum = 0x%x", ntohs(hdr->Checksum)); + Log_Debug("UDP", "%i bytes :%i->:%i (Cksum 0x%04x)", + ntohs(hdr->Length), ntohs(hdr->SourcePort), ntohs(hdr->Length), ntohs(hdr->Checksum)); // Check registered connections Mutex_Acquire(&glUDP_Channels); diff --git a/Usermode/Applications/irc_src/main.c b/Usermode/Applications/irc_src/main.c index 3448dbd1..4ca24155 100644 --- a/Usermode/Applications/irc_src/main.c +++ b/Usermode/Applications/irc_src/main.c @@ -340,7 +340,7 @@ tMessage *Message_AppendF(tServer *Server, int Type, const char *Source, const c va_list args; int len; va_start(args, Message); - len = vsnprintf(NULL, 1000, Message, args); + len = vsnprintf(NULL, 0, Message, args); { char buf[len+1]; vsnprintf(buf, len+1, Message, args); @@ -602,6 +602,10 @@ void ParseServerLine(tServer *Server, char *Line) } //printf("[%s] NOTICE %s: %s\n", Server->Name, ident, message); + char *ident_bang = strchr(ident, '!'); + if( ident_bang ) { + *ident_bang = '\0'; + } Message_Append(Server, MSG_TYPE_NOTICE, ident, "", message); } else if( strcmp(cmd, "PRIVMSG") == 0 ) @@ -619,7 +623,10 @@ void ParseServerLine(tServer *Server, char *Line) // TODO: Catch when the privmsg is addressed to the user // Cmd_PRIVMSG(Server, dest, ident, message); - *strchr(ident, '!') = '\0'; // Hello SIGSEGV + char *ident_bang = strchr(ident, '!'); + if( ident_bang ) { + *ident_bang = '\0'; + } Message_Append(Server, MSG_TYPE_STANDARD, ident, dest, message); } else if( strcmp(cmd, "JOIN" ) == 0 ) @@ -709,7 +716,7 @@ int writef(int FD, const char *Format, ...) int len; va_start(args, Format); - len = vsnprintf(NULL, 1000, Format, args); + len = vsnprintf(NULL, 0, Format, args); va_end(args); { diff --git a/Usermode/Filesystem/Conf/inittab b/Usermode/Filesystem/Conf/inittab index 799d2efe..cf075847 100644 --- a/Usermode/Filesystem/Conf/inittab +++ b/Usermode/Filesystem/Conf/inittab @@ -1,4 +1,4 @@ -exec /Acess/Bin/dhcpc +exec /Acess/SBin/dhcpc ktty 0 /Acess/SBin/login ktty 1 /Acess/SBin/login diff --git a/Usermode/Libraries/libnet.so_src/socket.c b/Usermode/Libraries/libnet.so_src/socket.c index f5933f22..85f7e54f 100644 --- a/Usermode/Libraries/libnet.so_src/socket.c +++ b/Usermode/Libraries/libnet.so_src/socket.c @@ -22,17 +22,17 @@ int Net_OpenSocket(int AddrType, void *Addr, const char *Filename) if(Filename) { - int len = snprintf(NULL, 100, "/Devices/ip/routes/@%i:%s/%s", AddrType, hexAddr, Filename); + int len = snprintf(NULL, 0, "/Devices/ip/routes/@%i:%s/%s", AddrType, hexAddr, Filename); char path[len+1]; - snprintf(path, 100, "/Devices/ip/routes/@%i:%s/%s", AddrType, hexAddr, Filename); + snprintf(path, len+1, "/Devices/ip/routes/@%i:%s/%s", AddrType, hexAddr, Filename); _SysDebug("%s", path); return _SysOpen(path, OPENFLAG_READ|OPENFLAG_WRITE); } else { - int len = snprintf(NULL, 100, "/Devices/ip/routes/@%i:%s", AddrType, hexAddr); + int len = snprintf(NULL, 0, "/Devices/ip/routes/@%i:%s", AddrType, hexAddr); char path[len+1]; - snprintf(path, 100, "/Devices/ip/routes/@%i:%s", AddrType, hexAddr); + snprintf(path, len+1, "/Devices/ip/routes/@%i:%s", AddrType, hexAddr); return _SysOpen(path, OPENFLAG_READ); } }