FreeBSD kernel IPv4 code
ip_fastfwd.c File Reference
#include <sys/cdefs.h>
#include "opt_ipstealth.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/protosw.h>
#include <sys/sdt.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <net/if.h>
#include <net/if_types.h>
#include <net/if_var.h>
#include <net/if_dl.h>
#include <net/pfil.h>
#include <net/route.h>
#include <net/route/nhop.h>
#include <net/vnet.h>
#include <netinet/in.h>
#include <netinet/in_fib.h>
#include <netinet/in_kdtrace.h>
#include <netinet/in_systm.h>
#include <netinet/in_var.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#include <netinet/ip_icmp.h>
#include <netinet/ip_options.h>
#include <machine/in_cksum.h>
Include dependency graph for ip_fastfwd.c:

Go to the source code of this file.

Macros

#define V_ipsendredirects   VNET(ipsendredirects)
 

Functions

 __FBSDID ("$FreeBSD$")
 
static struct mbuf * ip_redir_alloc (struct mbuf *m, struct nhop_object *nh, u_short ip_len, struct in_addr *osrc, struct in_addr *newgw)
 
static int ip_findroute (struct nhop_object **pnh, struct in_addr dest, struct mbuf *m)
 
struct mbuf * ip_tryforward (struct mbuf *m)
 

Macro Definition Documentation

◆ V_ipsendredirects

#define V_ipsendredirects   VNET(ipsendredirects)

Definition at line 106 of file ip_fastfwd.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ ip_findroute()

static int ip_findroute ( struct nhop_object **  pnh,
struct in_addr  dest,
struct mbuf *  m 
)
static

Definition at line 193 of file ip_fastfwd.c.

References fib4_lookup(), icmp_error(), ICMP_UNREACH, ICMP_UNREACH_HOST, and IPSTAT_INC.

Referenced by ip_tryforward().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ip_redir_alloc()

static struct mbuf * ip_redir_alloc ( struct mbuf *  m,
struct nhop_object *  nh,
u_short  ip_len,
struct in_addr osrc,
struct in_addr newgw 
)
static

Definition at line 109 of file ip_fastfwd.c.

References in_ifaddr::ia_subnet, in_ifaddr::ia_subnetmask, ip_len, and in_addr::s_addr.

Referenced by ip_tryforward().

Here is the caller graph for this function:

◆ ip_tryforward()