diff options
author | Neale Ranns <nranns@cisco.com> | 2018-06-27 18:59:03 -0700 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-06-29 09:56:16 +0000 |
commit | c667ffd4af4bb0a0576ceefcc29e3bb086a823c2 (patch) | |
tree | c4b664b55de1c826bd0f8ccb583b6c7ed7dc5d53 /src/vnet/ip/ip4_input.h | |
parent | 09fdf9d074430032c27aba9e12e52440c7de2006 (diff) |
IP4 Router Alert option handling for IGMP
and a new ip4-options node, inserted between ip4-input and ip4-punt,
that checks for IP-router-alert option + IGMP combination and sends
the packet to the ip4-local. This is required because some IGMP
packets are sent to the group address and not the all-routers address.
All IGMP packets are sent with the router alert option.
Change-Id: I01f478d4d98ac9f806e0bcba0f6da6e4e7d26e2a
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip4_input.h')
-rw-r--r-- | src/vnet/ip/ip4_input.h | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/vnet/ip/ip4_input.h b/src/vnet/ip/ip4_input.h index 889b423d700..880896e6430 100644 --- a/src/vnet/ip/ip4_input.h +++ b/src/vnet/ip/ip4_input.h @@ -49,6 +49,7 @@ typedef enum { IP4_INPUT_NEXT_DROP, IP4_INPUT_NEXT_PUNT, + IP4_INPUT_NEXT_OPTIONS, IP4_INPUT_NEXT_LOOKUP, IP4_INPUT_NEXT_LOOKUP_MULTICAST, IP4_INPUT_NEXT_ICMP_ERROR, @@ -153,7 +154,7 @@ ip4_input_check_x4 (vlib_main_t * vm, } else next[0] = error0 != IP4_ERROR_OPTIONS ? - IP4_INPUT_NEXT_DROP : IP4_INPUT_NEXT_PUNT; + IP4_INPUT_NEXT_DROP : IP4_INPUT_NEXT_OPTIONS; p[0]->error = error_node->errors[error0]; } if (PREDICT_FALSE (error1 != IP4_ERROR_NONE)) @@ -167,7 +168,7 @@ ip4_input_check_x4 (vlib_main_t * vm, } else next[1] = error1 != IP4_ERROR_OPTIONS ? - IP4_INPUT_NEXT_DROP : IP4_INPUT_NEXT_PUNT; + IP4_INPUT_NEXT_DROP : IP4_INPUT_NEXT_OPTIONS; p[1]->error = error_node->errors[error1]; } if (PREDICT_FALSE (error2 != IP4_ERROR_NONE)) @@ -181,7 +182,7 @@ ip4_input_check_x4 (vlib_main_t * vm, } else next[2] = error2 != IP4_ERROR_OPTIONS ? - IP4_INPUT_NEXT_DROP : IP4_INPUT_NEXT_PUNT; + IP4_INPUT_NEXT_DROP : IP4_INPUT_NEXT_OPTIONS; p[2]->error = error_node->errors[error2]; } if (PREDICT_FALSE (error3 != IP4_ERROR_NONE)) @@ -195,7 +196,7 @@ ip4_input_check_x4 (vlib_main_t * vm, } else next[3] = error3 != IP4_ERROR_OPTIONS ? - IP4_INPUT_NEXT_DROP : IP4_INPUT_NEXT_PUNT; + IP4_INPUT_NEXT_DROP : IP4_INPUT_NEXT_OPTIONS; p[3]->error = error_node->errors[error3]; } } @@ -256,7 +257,7 @@ ip4_input_check_x2 (vlib_main_t * vm, } else *next0 = error0 != IP4_ERROR_OPTIONS ? - IP4_INPUT_NEXT_DROP : IP4_INPUT_NEXT_PUNT; + IP4_INPUT_NEXT_DROP : IP4_INPUT_NEXT_OPTIONS; p0->error = error_node->errors[error0]; } if (PREDICT_FALSE (error1 != IP4_ERROR_NONE)) @@ -270,10 +271,9 @@ ip4_input_check_x2 (vlib_main_t * vm, } else *next1 = error1 != IP4_ERROR_OPTIONS ? - IP4_INPUT_NEXT_DROP : IP4_INPUT_NEXT_PUNT; + IP4_INPUT_NEXT_DROP : IP4_INPUT_NEXT_OPTIONS; p1->error = error_node->errors[error1]; } - } always_inline void @@ -290,11 +290,6 @@ ip4_input_check_x1 (vlib_main_t * vm, check_ver_opt_csum (ip0, &error0, verify_checksum); - /* Punt packets with options or wrong version. */ - if (PREDICT_FALSE (ip0->ip_version_and_header_length != 0x45)) - error0 = (ip0->ip_version_and_header_length & 0xf) != 5 ? - IP4_ERROR_OPTIONS : IP4_ERROR_VERSION; - /* Drop fragmentation offset 1 packets. */ error0 = ip4_get_fragment_offset (ip0) == 1 ? IP4_ERROR_FRAGMENT_OFFSET_ONE : error0; @@ -322,10 +317,9 @@ ip4_input_check_x1 (vlib_main_t * vm, } else *next0 = error0 != IP4_ERROR_OPTIONS ? - IP4_INPUT_NEXT_DROP : IP4_INPUT_NEXT_PUNT; + IP4_INPUT_NEXT_DROP : IP4_INPUT_NEXT_OPTIONS; p0->error = error_node->errors[error0]; } - } /* |