diff options
Diffstat (limited to 'sys/netinet/vinet.h')
| -rw-r--r-- | sys/netinet/vinet.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sys/netinet/vinet.h b/sys/netinet/vinet.h index 005a46b27fe5..5fdb1c0c28b0 100644 --- a/sys/netinet/vinet.h +++ b/sys/netinet/vinet.h @@ -33,11 +33,12 @@ #ifndef _NETINET_VINET_H_ #define _NETINET_VINET_H_ -#ifdef VIMAGE #include <sys/socketvar.h> #include <sys/sysctl.h> #include <sys/md5.h> +#include <net/vnet.h> + #include <netinet/in.h> #include <netinet/in_systm.h> #include <netinet/in_var.h> @@ -196,8 +197,6 @@ struct vnet_inet { int _icmp_quotelen; int _icmpbmcastecho; }; -#endif - /* * Symbol translation macros @@ -333,4 +332,16 @@ struct vnet_inet { #define V_udpstat VNET_INET(udpstat) #define V_useloopback VNET_INET(useloopback) +static __inline uint16_t ip_newid(void); +extern int ip_do_randomid; + +static __inline uint16_t +ip_newid(void) +{ + if (V_ip_do_randomid) + return ip_randomid(); + + return htons(V_ip_id++); +} + #endif /* !_NETINET_VINET_H_ */ |
