kernel: Synchronize inet_addr.c to remove advertising clause.
Change-Id: I03665bcad679e3fddaea0d8a95663be12b003bd8 Reviewed-on: https://review.haiku-os.org/c/haiku/+/6877 Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
parent
56241aab2f
commit
4dcc1ed654
@ -1,4 +1,6 @@
|
||||
/*
|
||||
/*-
|
||||
* SPDX-License-Identifier: (BSD-3-Clause AND ISC)
|
||||
*
|
||||
* Copyright (c) 1983, 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
@ -10,11 +12,7 @@
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
@ -176,23 +174,23 @@ inet_aton(const char *cp, struct in_addr *addr) {
|
||||
case 2: /*%< a.b -- 8.24 bits */
|
||||
if (val > 0xffffffU)
|
||||
return (0);
|
||||
val |= parts[0] << 24;
|
||||
val |= (uint32_t)parts[0] << 24;
|
||||
break;
|
||||
|
||||
case 3: /*%< a.b.c -- 8.8.16 bits */
|
||||
if (val > 0xffffU)
|
||||
return (0);
|
||||
val |= (parts[0] << 24) | (parts[1] << 16);
|
||||
val |= ((uint32_t)parts[0] << 24) | (parts[1] << 16);
|
||||
break;
|
||||
|
||||
case 4: /*%< a.b.c.d -- 8.8.8.8 bits */
|
||||
if (val > 0xffU)
|
||||
return (0);
|
||||
val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
|
||||
val |= ((uint32_t)parts[0] << 24) | (parts[1] << 16) |
|
||||
(parts[2] << 8);
|
||||
break;
|
||||
}
|
||||
if (addr != NULL)
|
||||
addr->s_addr = htonl(val);
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user