2008-04-21 Dan Williams <dcbw@redhat.com>
* src/nm-ip4-config.c - (nm_ip4_config_to_rtnl_addr): fill in the broadcast address if it's not specified (rh #443474) git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3581 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2008-04-21 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
|
* src/nm-ip4-config.c
|
||||||
|
- (nm_ip4_config_to_rtnl_addr): fill in the broadcast address if it's
|
||||||
|
not specified (rh #443474)
|
||||||
|
|
||||||
2008-04-20 Dan Williams <dcbw@redhat.com>
|
2008-04-20 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
* src/NetworkManagerUtils.c
|
* src/NetworkManagerUtils.c
|
||||||
|
@@ -460,8 +460,20 @@ struct rtnl_addr * nm_ip4_config_to_rtnl_addr (NMIP4Config *config, guint32 flag
|
|||||||
if (flags & NM_RTNL_ADDR_NETMASK)
|
if (flags & NM_RTNL_ADDR_NETMASK)
|
||||||
ip4_addr_to_rtnl_prefixlen (priv->ip4_netmask, addr);
|
ip4_addr_to_rtnl_prefixlen (priv->ip4_netmask, addr);
|
||||||
|
|
||||||
if (flags & NM_RTNL_ADDR_BROADCAST)
|
if (flags & NM_RTNL_ADDR_BROADCAST) {
|
||||||
success = (ip4_addr_to_rtnl_broadcast (priv->ip4_broadcast, addr) >= 0);
|
guint32 bcast = priv->ip4_broadcast;
|
||||||
|
|
||||||
|
/* Calculate the broadcast address if needed */
|
||||||
|
if (!bcast) {
|
||||||
|
guint32 hostmask, network;
|
||||||
|
|
||||||
|
network = ntohl (priv->ip4_address) & ntohl (priv->ip4_netmask);
|
||||||
|
hostmask = ~ntohl (priv->ip4_netmask);
|
||||||
|
bcast = htonl (network | hostmask);
|
||||||
|
}
|
||||||
|
|
||||||
|
success = (ip4_addr_to_rtnl_broadcast (bcast, addr) >= 0);
|
||||||
|
}
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user