utils: use gssize (signed) 'len' parameter in nm_ethernet_address_is_valid()
Fix copyright statement too.
This commit is contained in:
@@ -15,8 +15,8 @@
|
|||||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2004 - 2014 Red Hat, Inc.
|
* Copyright 2004 - 2014 Red Hat, Inc.
|
||||||
* Copyright (C) 2005 - 2008 Novell, Inc.
|
* Copyright 2005 - 2008 Novell, Inc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@@ -57,13 +57,16 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* nm_ethernet_address_is_valid
|
* nm_ethernet_address_is_valid:
|
||||||
|
* @addr: pointer to a binary or ASCII Ethernet address
|
||||||
|
* @len: length of @addr, or -1 if @addr is ASCII
|
||||||
*
|
*
|
||||||
* Compares an Ethernet address against known invalid addresses.
|
* Compares an Ethernet address against known invalid addresses.
|
||||||
*
|
|
||||||
|
* Returns: %TRUE if @addr is a valid Ethernet address, %FALSE if it is not.
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
nm_ethernet_address_is_valid (gconstpointer addr, gsize len)
|
nm_ethernet_address_is_valid (gconstpointer addr, gssize len)
|
||||||
{
|
{
|
||||||
guint8 invalid_addr1[ETH_ALEN] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
guint8 invalid_addr1[ETH_ALEN] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
||||||
guint8 invalid_addr2[ETH_ALEN] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
guint8 invalid_addr2[ETH_ALEN] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
|
@@ -15,8 +15,8 @@
|
|||||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2004 - 2014 Red Hat, Inc.
|
* Copyright 2004 - 2014 Red Hat, Inc.
|
||||||
* Copyright (C) 2005 - 2008 Novell, Inc.
|
* Copyright 2005 - 2008 Novell, Inc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __NETWORKMANAGER_UTILS_H__
|
#ifndef __NETWORKMANAGER_UTILS_H__
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
#include "nm-connection.h"
|
#include "nm-connection.h"
|
||||||
#include "nm-platform.h"
|
#include "nm-platform.h"
|
||||||
|
|
||||||
gboolean nm_ethernet_address_is_valid (gconstpointer addr, gsize len);
|
gboolean nm_ethernet_address_is_valid (gconstpointer addr, gssize len);
|
||||||
|
|
||||||
in_addr_t nm_utils_ip4_address_clear_host_address (in_addr_t addr, guint8 plen);
|
in_addr_t nm_utils_ip4_address_clear_host_address (in_addr_t addr, guint8 plen);
|
||||||
void nm_utils_ip6_address_clear_host_address (struct in6_addr *dst, const struct in6_addr *src, guint8 plen);
|
void nm_utils_ip6_address_clear_host_address (struct in6_addr *dst, const struct in6_addr *src, guint8 plen);
|
||||||
|
Reference in New Issue
Block a user