/*
* netof - return the net address part of an ip address in a sockaddr_u structure
* (zero out host part)
*/
#include <config.h>
#include <stdio.h>
#include <syslog.h>
/*
* Return the network portion of a host address. Used by ntp_io.c
* findbcastinter() to find a multicast/broadcast interface for
* a given remote address. Note static storage is used, with room
* for only two addresses, which is all that is needed at present.
*
*/
sockaddr_u *
netof(
sockaddr_u *hostaddr
)
{
static sockaddr_u netofbuf[2];
static int next_netofbuf;
u_int32 netnum;
sockaddr_u * netaddr;