mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-22 02:35:25 +00:00
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:
parent
78e86f91fe
commit
c961481677
|
@ -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>
|
||||
|
||||
* 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)
|
||||
ip4_addr_to_rtnl_prefixlen (priv->ip4_netmask, addr);
|
||||
|
||||
if (flags & NM_RTNL_ADDR_BROADCAST)
|
||||
success = (ip4_addr_to_rtnl_broadcast (priv->ip4_broadcast, addr) >= 0);
|
||||
if (flags & NM_RTNL_ADDR_BROADCAST) {
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue