Mask an IP address and give its broadcast Background
Inspired by this Unix.SE question (and of course my own answer).
When an IP address is specified for an interface, it is often given in this dotted-decimal form:
a.b.c.d e.f.g.h

where a.b.c.d is the actual address and e.f.g.h is the netmask.
The netmask, when represented in binary, is basically a bunch of 1 bits followed by a bunch of 0 bits.  When the netmask is bitwise ANDed against the given IP address, result will be the network portion of the address, or simply the network address.  This will be programmed into the host's route table so that the host knows to send anything destined for this network out this interface.
The broadcast address for a network is derived by taking the network address (from above) and setting all the host-bits to 1.  The broadcast address is used to send to all addresses within the given network.
Challenge
Given a dotted-decimal IP address and valid netmask as input, provide the network address and broadcast address as output, also in dotted-decimal format.

Input must be address and mask as two strings in dotted-decimal format.  You may pass this as 2 separate strings, as list or array of 2 string elements or a single string with the address and mask separated by some sensible separator.
Output format is subject to the same constraints as input format.

Examples
Input                              Output

192.168.0.1 255.255.255.0          192.168.0.0 192.168.0.255
192.168.0.0 255.255.255.0          192.168.0.0 192.168.0.255
192.168.0.255 255.255.255.0        192.168.0.0 192.168.0.255
100.200.100.200 255.255.255.255    100.200.100.200 100.200.100.200
1.2.3.4 0.0.0.0                    0.0.0.0 255.255.255.255
10.25.30.40 255.252.0.0            10.24.0.0 10.27.255.255
JavaScript (ES6), 92 bytes

(a,m)=&gt;a.split`.`.map((n,i)=&gt;(v=m[i],m[i]=n&amp;v|v^255,n&amp;v),m=m.split`.`).join`.`+" "+m.join`.`


Explanation

(a,m)=&gt;
  a.split`.`
  .map((n,i)=&gt;(
      v=m[i],
      m[i]=n&amp;v|v^255,
      n&amp;v
    ),
    m=m.split`.`
  ).join`.`
  +" "+m.join`.`


Test



var solution = (a,m)=&gt;a.split`.`.map((n,i)=&gt;(v=m[i],m[i]=n&amp;v|v^255,n&amp;v),m=m.split`.`).join`.`+" "+m.join`.`
&lt;input type="text" id="input" value="10.25.30.40 255.252.0.0" /&gt;
&lt;button onclick="result.textContent=solution.apply(null,input.value.split` `)"&gt;Go&lt;/button&gt;
&lt;pre id="result"&gt;&lt;/pre&gt;