diff options
author | Neale Ranns <nranns@cisco.com> | 2017-03-11 05:55:21 -0800 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2017-03-17 15:49:39 +0000 |
commit | 4b919a56642ccd0a44920feace872aeb5b7a62cf (patch) | |
tree | 17750f4efc80d7863b68f9cd08ab381cd00dd534 /src/vnet/fib/fib_path.c | |
parent | c60f557590f79b8817382bdd982825b66c4e0a73 (diff) |
Attached hosts
allow this config to function:
set int ip address loop0 169.254.1.1/32 (the default GW address for attached hosts)
set int unnumbered af_packet0 use loop0 ('enable' IP on the host interface)
ip route add 192.168.1.1/32 via af_packet0 (where to find the host)
repeat for each host and host interface.
Inter-host communication is throught the /32 routes.
To allow this:
1 - attached host routes have the ATTACHED flag set, so the ARP code accepts then as legitimate sources
2 - unnumbered interfaces inherit the source address from the IP interface
Change-Id: Ib66c5f0e848c528f79372813adc3a0c11b50717f
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/fib/fib_path.c')
-rw-r--r-- | src/vnet/fib/fib_path.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vnet/fib/fib_path.c b/src/vnet/fib/fib_path.c index aa545b5ed45..3ed309f328b 100644 --- a/src/vnet/fib/fib_path.c +++ b/src/vnet/fib/fib_path.c @@ -110,6 +110,10 @@ typedef enum fib_path_oper_attribute_t_ { */ FIB_PATH_OPER_ATTRIBUTE_RESOLVED, /** + * The path is attached, despite what the next-hop may say. + */ + FIB_PATH_OPER_ATTRIBUTE_ATTACHED, + /** * The path has become a permanent drop. */ FIB_PATH_OPER_ATTRIBUTE_DROP, @@ -143,6 +147,7 @@ typedef enum fib_path_oper_flags_t_ { FIB_PATH_OPER_FLAG_RECURSIVE_LOOP = (1 << FIB_PATH_OPER_ATTRIBUTE_RECURSIVE_LOOP), FIB_PATH_OPER_FLAG_DROP = (1 << FIB_PATH_OPER_ATTRIBUTE_DROP), FIB_PATH_OPER_FLAG_RESOLVED = (1 << FIB_PATH_OPER_ATTRIBUTE_RESOLVED), + FIB_PATH_OPER_FLAG_ATTACHED = (1 << FIB_PATH_OPER_ATTRIBUTE_ATTACHED), } __attribute__ ((packed)) fib_path_oper_flags_t; /** @@ -963,6 +968,8 @@ fib_path_route_flags_to_cfg_flags (const fib_route_path_t *rpath) cfg_flags |= FIB_PATH_CFG_FLAG_RESOLVE_ATTACHED; if (rpath->frp_flags & FIB_ROUTE_PATH_LOCAL) cfg_flags |= FIB_PATH_CFG_FLAG_LOCAL; + if (rpath->frp_flags & FIB_ROUTE_PATH_ATTACHED) + cfg_flags |= FIB_PATH_CFG_FLAG_ATTACHED; return (cfg_flags); } |