Skip to content

Commit 0502b78

Browse files
Replicate VXLAN UDP sport security to switch level
- Add SAI_SWITCH_TUNNEL_ATTR_VXLAN_UDP_SPORT_SECURITY attribute to drop tunnel packets with UDP source port outside allowed range - Add documentation for UDP source port validation on VXLAN packet ingress - Update both saiswitch.h and saitunnel.h with security clarifications
1 parent b925fc0 commit 0502b78

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

inc/saiswitch.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,10 @@ typedef enum _sai_switch_tunnel_attr_t
504504
/**
505505
* @brief Tunnel UDP source port
506506
*
507+
* See also SAI_SWITCH_TUNNEL_ATTR_VXLAN_UDP_SPORT_SECURITY.
508+
* This attribute is applied to VXLAN pockets ingressing the switch. If the incoming
509+
* packet does not match the configured UDP source port range, the packet is dropped.
510+
*
507511
* @type sai_uint16_t
508512
* @flags CREATE_AND_SET
509513
* @isvlan false
@@ -576,6 +580,20 @@ typedef enum _sai_switch_tunnel_attr_t
576580
*/
577581
SAI_SWITCH_TUNNEL_ATTR_DECAP_QOS_TC_TO_PRIORITY_GROUP_MAP,
578582

583+
/**
584+
* @brief Drop tunnel packets with not allowed UDP source port
585+
*
586+
* Upon enabling this feature, if the tunnel packet ingresses with
587+
* UDP source port outside of range defined for this tunnel, it
588+
* will be dropped.
589+
*
590+
* @type bool
591+
* @flags CREATE_AND_SET
592+
* @default false
593+
* @validonly SAI_SWITCH_TUNNEL_ATTR_TUNNEL_TYPE == SAI_TUNNEL_TYPE_VXLAN and SAI_SWITCH_TUNNEL_ATTR_TUNNEL_VXLAN_UDP_SPORT_MODE == SAI_TUNNEL_VXLAN_UDP_SPORT_MODE_USER_DEFINED
594+
*/
595+
SAI_SWITCH_TUNNEL_ATTR_VXLAN_UDP_SPORT_SECURITY,
596+
579597
/**
580598
* @brief End of attributes
581599
*/

inc/saitunnel.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,10 @@ typedef enum _sai_tunnel_attr_t
660660
/**
661661
* @brief Tunnel UDP source port
662662
*
663+
* See also SAI_TUNNEL_ATTR_VXLAN_UDP_SPORT_SECURITY.
664+
* This attribute is applied to VXLAN pockets ingressing the switch. If the incoming
665+
* packet does not match the configured UDP source port range, the packet is dropped.
666+
*
663667
* @type sai_uint16_t
664668
* @flags CREATE_AND_SET
665669
* @isvlan false

0 commit comments

Comments
 (0)