* On Haiku, ifreq::ifr_name always includes the trailing null byte. Adjusted

userland code to take this into account (the kernel would just cut off the
  name).
* This closes ticket #6280.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37689 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2010-07-22 12:35:44 +00:00
parent 74a4c33fda
commit 6600877a5f
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -387,7 +387,7 @@ usage(int status)
bool
prepare_request(struct ifreq& request, const char* name)
{
if (strlen(name) > IF_NAMESIZE) {
if (strlen(name) >= IF_NAMESIZE) {
fprintf(stderr, "%s: interface name \"%s\" is too long.\n",
kProgramName, name);
return false;
+1 -1
View File
@@ -280,7 +280,7 @@ usage(int status)
bool
prepare_request(struct ifreq& request, const char* name)
{
if (strlen(name) > IF_NAMESIZE) {
if (strlen(name) >= IF_NAMESIZE) {
fprintf(stderr, "%s: interface name \"%s\" is too long.\n",
kProgramName, name);
return false;
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2008, Haiku, Inc. All Rights Reserved.
* Copyright 2006-2010, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -29,7 +29,7 @@
bool
prepare_request(struct ifreq& request, const char* name)
{
if (strlen(name) > IF_NAMESIZE) {
if (strlen(name) >= IF_NAMESIZE) {
return false;
}
+1 -1
View File
@@ -206,7 +206,7 @@ set_port(int32 familyIndex, struct sockaddr& address, int32 port)
bool
prepare_request(ifreq& request, const char* name)
{
if (strlen(name) > IF_NAMESIZE)
if (strlen(name) >= IF_NAMESIZE)
return false;
strcpy(request.ifr_name, name);